From 292f06beb7fb2ca57d4b3ad71239e6272cf5b323 Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Fri, 16 Feb 2024 18:48:13 +0100 Subject: [PATCH] Fixes e2e tests (#1761) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fixes e2e tests Signed-off-by: Mihovil Ilakovac * Adds new e2e tests * Update build tests --------- Signed-off-by: Mihovil Ilakovac Co-authored-by: Filip Sodić --- waspc/e2e-test/ShellCommands.hs | 12 +- waspc/e2e-test/Tests/WaspComplexTest.hs | 56 +- waspc/e2e-test/Tests/WaspJobTest.hs | 4 +- .../waspBuild-golden/files.manifest | 244 ++++-- .../waspBuild/.wasp/build/.waspchecksums | 387 ++++++---- .../waspBuild/.wasp/build/Dockerfile | 43 +- .../waspBuild/.wasp/build/db/schema.prisma | 1 - .../installedFullStackNpmDependencies.json | 1 - .../.wasp/build/installedNpmDepsLog.json | 1 + .../waspBuild/.wasp/build/server/nodemon.json | 2 + .../waspBuild/.wasp/build/server/package.json | 33 +- .../.wasp/build/server/rollup.config.js | 24 + .../build/server/scripts/validate-env.mjs | 2 +- .../.wasp/build/server/src/actions/types.ts | 2 +- .../waspBuild/.wasp/build/server/src/app.js | 2 +- .../.wasp/build/server/src/core/AuthError.js | 17 - .../.wasp/build/server/src/dbClient.ts | 12 - .../.wasp/build/server/src/dbSeed/types.ts | 3 - .../server/src/middleware/globalMiddleware.ts | 8 +- .../build/server/src/middleware/operations.ts | 2 +- .../.wasp/build/server/src/queries/types.ts | 2 +- .../.wasp/build/server/src/server.ts | 2 +- .../.wasp/build/server/tsconfig.json | 33 +- .../.wasp/build/web-app/package.json | 17 +- .../.wasp/build/web-app/public/.gitkeep | 0 .../build/web-app/scripts/validate-env.mjs | 2 +- .../build/web-app/src/ext-src/vite-env.d.ts | 1 - .../.wasp/build/web-app/src/index.tsx | 2 +- .../build/web-app/src/queries/index.d.ts | 10 - .../.wasp/build/web-app/src/queries/index.js | 18 - .../.wasp/build/web-app/src/router.tsx | 26 +- .../build/web-app/src/test/vitest/setup.ts | 10 +- .../.wasp/build/web-app/tsconfig.json | 14 +- .../.wasp/build/web-app/vite.config.ts | 25 +- .../src => out/sdk/wasp}/api/events.ts | 0 .../src/api.ts => out/sdk/wasp/api/index.ts} | 16 +- .../types.ts => out/sdk/wasp/client/index.ts} | 2 + .../wasp/client/operations}/actions/core.d.ts | 5 +- .../wasp/client/operations}/actions/core.js | 7 +- .../wasp/client/operations/actions/index.ts | 1 + .../sdk/wasp/client/operations/core.ts} | 223 ++++-- .../out/sdk/wasp/client/operations/index.ts | 22 + .../wasp/client/operations/internal}/index.ts | 9 +- .../client/operations/internal}/resources.js | 4 +- .../operations/internal}/updateHandlersMap.js | 0 .../wasp/client/operations}/queries/core.d.ts | 16 +- .../wasp/client/operations}/queries/core.js | 13 +- .../wasp/client/operations/queries/index.ts | 4 + .../sdk/wasp/client/operations/queryClient.ts | 34 + .../out/sdk/wasp/client}/router/Link.tsx | 3 +- .../.wasp/out/sdk/wasp/client/router/index.ts | 22 + .../sdk/wasp/client}/router/linkHelpers.ts | 1 + .../out/sdk/wasp/client}/router/types.ts | 5 + .../src => out/sdk/wasp/client}/test/index.ts | 0 .../sdk/wasp/client}/test/vitest/helpers.tsx | 12 +- .../.wasp/out/sdk/wasp/core/config.ts} | 2 +- .../src => out/sdk/wasp/core}/storage.ts | 0 .../waspBuild/.wasp/out/sdk/wasp/dev/index.ts | 17 + .../.wasp/out/sdk/wasp/dist/api/events.d.ts | 7 + .../.wasp/out/sdk/wasp/dist/api/events.js | 4 + .../.wasp/out/sdk/wasp/dist/api/events.js.map | 1 + .../.wasp/out/sdk/wasp/dist/api/index.d.ts | 15 + .../.wasp/out/sdk/wasp/dist/api/index.js | 96 +++ .../.wasp/out/sdk/wasp/dist/api/index.js.map | 1 + .../.wasp/out/sdk/wasp/dist/client/index.d.ts | 10 + .../.wasp/out/sdk/wasp/dist/client/index.js | 10 + .../out/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 + .../out/sdk/wasp/dist/client/router/Link.d.ts | 8 + .../out/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 + .../out/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 + .../out/sdk/wasp/dist/client/router/types.js | 2 + .../sdk/wasp/dist/client/router/types.js.map | 1 + .../out/sdk/wasp/dist/client/test/index.d.ts | 1 + .../out/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 + .../.wasp/out/sdk/wasp/dist/core/config.d.ts | 4 + .../.wasp/out/sdk/wasp/dist/core/config.js | 7 + .../out/sdk/wasp/dist/core/config.js.map | 1 + .../.wasp/out/sdk/wasp/dist/core/storage.d.ts | 8 + .../.wasp/out/sdk/wasp/dist/core/storage.js | 41 + .../out/sdk/wasp/dist/core/storage.js.map | 1 + .../.wasp/out/sdk/wasp/dist/dev/index.d.ts | 11 + .../.wasp/out/sdk/wasp/dist/dev/index.js | 16 + .../.wasp/out/sdk/wasp/dist/dev/index.js.map | 1 + .../out/sdk/wasp/dist/entities/index.d.ts | 3 + .../.wasp/out/sdk/wasp/dist/entities/index.js | 2 + .../out/sdk/wasp/dist/entities/index.js.map | 1 + .../out/sdk/wasp/dist/ext-src/MainPage.d.ts | 1 + .../out/sdk/wasp/dist/ext-src/MainPage.jsx | 29 + .../sdk/wasp/dist/ext-src/MainPage.jsx.map | 1 + .../out/sdk/wasp/dist/server/HttpError.d.ts | 5 + .../out/sdk/wasp/dist/server/HttpError.js | 17 + .../out/sdk/wasp/dist/server/HttpError.js.map | 1 + .../sdk/wasp/dist/server/_types/index.d.ts | 18 + .../out/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 + .../out/sdk/wasp/dist/server/config.d.ts | 15 + .../.wasp/out/sdk/wasp/dist/server/config.js | 32 + .../out/sdk/wasp/dist/server/config.js.map | 1 + .../out/sdk/wasp/dist/server/dbClient.d.ts | 2 + .../out/sdk/wasp/dist/server/dbClient.js | 12 + .../out/sdk/wasp/dist/server/dbClient.js.map | 1 + .../.wasp/out/sdk/wasp/dist/server/index.d.ts | 7 + .../.wasp/out/sdk/wasp/dist/server/index.js | 7 + .../out/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 + .../out/sdk/wasp/dist/server/types/index.d.ts | 8 + .../out/sdk/wasp/dist/server/types/index.js | 2 + .../sdk/wasp/dist/server/types/index.js.map | 1 + .../.wasp/out/sdk/wasp/dist/server/utils.d.ts | 12 + .../.wasp/out/sdk/wasp/dist/server/utils.js | 17 + .../out/sdk/wasp/dist/server/utils.js.map | 1 + .../out/sdk/wasp/dist/universal/types.d.ts | 5 + .../out/sdk/wasp/dist/universal/types.js | 2 + .../out/sdk/wasp/dist/universal/types.js.map | 1 + .../out/sdk/wasp/dist/universal/url.d.ts | 1 + .../.wasp/out/sdk/wasp/dist/universal/url.js | 4 + .../out/sdk/wasp/dist/universal/url.js.map | 1 + .../sdk/wasp/dist/universal/validators.d.ts | 2 + .../sdk/wasp/dist/universal/validators.js} | 5 +- .../sdk/wasp/dist/universal/validators.js.map | 1 + .../src => out/sdk/wasp}/entities/index.ts | 0 .../src => out/sdk/wasp}/ext-src/Main.css | 0 .../out/sdk/wasp/ext-src}/MainPage.jsx | 13 +- .../.wasp/out/sdk/wasp/ext-src/vite-env.d.ts | 1 + .../src => out/sdk/wasp}/ext-src/waspLogo.png | Bin .../waspBuild/.wasp/out/sdk/wasp/package.json | 101 +++ .../sdk/wasp/server/HttpError.ts} | 9 +- .../out/sdk/wasp/server}/_types/index.ts | 4 +- .../sdk/wasp/server}/_types/serialization.ts | 2 +- .../sdk/wasp/server}/_types/taggedEntities.ts | 2 +- .../sdk/wasp/server/config.ts} | 33 +- .../.wasp/out/sdk/wasp/server/dbClient.ts | 13 + .../.wasp/out/sdk/wasp/server/index.ts | 15 + .../server/middleware/globalMiddleware.ts | 8 + .../out/sdk/wasp/server/middleware/index.ts | 1 + .../wasp/server/operations/actions/index.ts | 2 + .../wasp/server/operations/actions/types.ts | 4 + .../out/sdk/wasp/server/operations/index.ts | 4 + .../wasp/server/operations/queries/index.ts | 2 + .../wasp/server/operations/queries/types.ts | 5 + .../sdk/wasp/server}/types/index.ts | 7 +- .../.wasp/out/sdk/wasp/server}/utils.ts | 30 - .../.wasp/out/sdk/wasp/tsconfig.json | 44 ++ .../src => out/sdk/wasp}/universal/types.ts | 0 .../src => out/sdk/wasp}/universal/url.ts | 0 .../out/sdk/wasp/universal/validators.ts | 21 + .../.wasp/out/sdk/wasp/vite-env.d.ts | 1 + .../waspBuild/{src => }/.waspignore | 0 .../waspBuild-golden/waspBuild/main.wasp | 2 +- .../waspBuild-golden/waspBuild/package.json | 13 + .../waspBuild/public/.gitkeep | 0 .../waspBuild/src/{client => }/Main.css | 0 .../waspBuild/src}/MainPage.jsx | 13 +- .../waspBuild/src/client/tsconfig.json | 55 -- .../waspBuild/src/client/vite-env.d.ts | 1 - .../waspBuild/src/server/tsconfig.json | 48 -- .../waspBuild/src/shared/tsconfig.json | 28 - .../waspBuild/src/vite-env.d.ts | 1 + .../waspBuild/src/{client => }/waspLogo.png | Bin .../waspBuild-golden/waspBuild/tsconfig.json | 34 + .../web-app/src/ext-src => }/vite.config.ts | 0 .../waspCompile-golden/files.manifest | 244 ++++-- .../waspCompile/.wasp/out/.waspchecksums | 395 ++++++---- .../waspCompile/.wasp/out/Dockerfile | 43 +- .../waspCompile/.wasp/out/db/schema.prisma | 1 - .../installedFullStackNpmDependencies.json | 1 - .../.wasp/out/installedNpmDepsLog.json | 1 + .../{web-app/src => sdk/wasp}/api/events.ts | 0 .../src/api.ts => sdk/wasp/api/index.ts} | 16 +- .../src/types.ts => sdk/wasp/client/index.ts} | 2 + .../wasp/client/operations}/actions/core.d.ts | 5 +- .../wasp/client/operations}/actions/core.js | 7 +- .../wasp/client/operations/actions/index.ts | 1 + .../wasp/client/operations/core.ts} | 223 ++++-- .../out/sdk/wasp/client/operations/index.ts | 22 + .../wasp/client/operations/internal}/index.ts | 9 +- .../client/operations/internal}/resources.js | 4 +- .../operations/internal}/updateHandlersMap.js | 0 .../wasp/client/operations}/queries/core.d.ts | 16 +- .../wasp/client/operations}/queries/core.js | 13 +- .../wasp/client/operations/queries/index.ts | 4 + .../sdk/wasp/client/operations/queryClient.ts | 34 + .../out/sdk/wasp/client}/router/Link.tsx | 3 +- .../.wasp/out/sdk/wasp/client/router/index.ts | 22 + .../sdk/wasp/client}/router/linkHelpers.ts | 1 + .../out/sdk/wasp/client}/router/types.ts | 5 + .../src => sdk/wasp/client}/test/index.ts | 0 .../sdk/wasp/client}/test/vitest/helpers.tsx | 12 +- .../.wasp/out/sdk/wasp/core/config.ts} | 2 +- .../{web-app/src => sdk/wasp/core}/storage.ts | 0 .../.wasp/out/sdk/wasp/dev/index.ts | 17 + .../.wasp/out/sdk/wasp/dist/api/events.d.ts | 7 + .../.wasp/out/sdk/wasp/dist/api/events.js | 4 + .../.wasp/out/sdk/wasp/dist/api/events.js.map | 1 + .../.wasp/out/sdk/wasp/dist/api/index.d.ts | 15 + .../.wasp/out/sdk/wasp/dist/api/index.js | 96 +++ .../.wasp/out/sdk/wasp/dist/api/index.js.map | 1 + .../.wasp/out/sdk/wasp/dist/client/index.d.ts | 10 + .../.wasp/out/sdk/wasp/dist/client/index.js | 10 + .../out/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 + .../out/sdk/wasp/dist/client/router/Link.d.ts | 8 + .../out/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 + .../out/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 + .../out/sdk/wasp/dist/client/router/types.js | 2 + .../sdk/wasp/dist/client/router/types.js.map | 1 + .../out/sdk/wasp/dist/client/test/index.d.ts | 1 + .../out/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 + .../.wasp/out/sdk/wasp/dist/core/config.d.ts | 4 + .../.wasp/out/sdk/wasp/dist/core/config.js | 7 + .../out/sdk/wasp/dist/core/config.js.map | 1 + .../.wasp/out/sdk/wasp/dist/core/storage.d.ts | 8 + .../.wasp/out/sdk/wasp/dist/core/storage.js | 41 + .../out/sdk/wasp/dist/core/storage.js.map | 1 + .../.wasp/out/sdk/wasp/dist/dev/index.d.ts | 11 + .../.wasp/out/sdk/wasp/dist/dev/index.js | 16 + .../.wasp/out/sdk/wasp/dist/dev/index.js.map | 1 + .../out/sdk/wasp/dist/entities/index.d.ts | 3 + .../.wasp/out/sdk/wasp/dist/entities/index.js | 2 + .../out/sdk/wasp/dist/entities/index.js.map | 1 + .../out/sdk/wasp/dist/ext-src/MainPage.d.ts | 1 + .../out/sdk/wasp/dist/ext-src/MainPage.jsx | 29 + .../sdk/wasp/dist/ext-src/MainPage.jsx.map | 1 + .../out/sdk/wasp/dist/server/HttpError.d.ts | 5 + .../out/sdk/wasp/dist/server/HttpError.js | 17 + .../out/sdk/wasp/dist/server/HttpError.js.map | 1 + .../sdk/wasp/dist/server/_types/index.d.ts | 18 + .../out/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 + .../out/sdk/wasp/dist/server/config.d.ts | 15 + .../.wasp/out/sdk/wasp/dist/server/config.js | 32 + .../out/sdk/wasp/dist/server/config.js.map | 1 + .../out/sdk/wasp/dist/server/dbClient.d.ts | 2 + .../out/sdk/wasp/dist/server/dbClient.js | 12 + .../out/sdk/wasp/dist/server/dbClient.js.map | 1 + .../.wasp/out/sdk/wasp/dist/server/index.d.ts | 7 + .../.wasp/out/sdk/wasp/dist/server/index.js | 7 + .../out/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 + .../out/sdk/wasp/dist/server/types/index.d.ts | 8 + .../out/sdk/wasp/dist/server/types/index.js | 2 + .../sdk/wasp/dist/server/types/index.js.map | 1 + .../.wasp/out/sdk/wasp/dist/server/utils.d.ts | 12 + .../.wasp/out/sdk/wasp/dist/server/utils.js | 17 + .../out/sdk/wasp/dist/server/utils.js.map | 1 + .../out/sdk/wasp/dist/universal/types.d.ts | 5 + .../out/sdk/wasp/dist/universal/types.js | 2 + .../out/sdk/wasp/dist/universal/types.js.map | 1 + .../out/sdk/wasp/dist/universal/url.d.ts | 1 + .../.wasp/out/sdk/wasp/dist/universal/url.js | 4 + .../out/sdk/wasp/dist/universal/url.js.map | 1 + .../sdk/wasp/dist/universal/validators.d.ts | 2 + .../sdk/wasp/dist/universal/validators.js} | 5 +- .../sdk/wasp/dist/universal/validators.js.map | 1 + .../src => sdk/wasp}/entities/index.ts | 0 .../src => sdk/wasp}/ext-src/Main.css | 0 .../out/sdk/wasp/ext-src}/MainPage.jsx | 13 +- .../.wasp/out/sdk/wasp/ext-src/vite-env.d.ts | 1 + .../src => sdk/wasp}/ext-src/waspLogo.png | Bin .../.wasp/out/sdk/wasp/package.json | 101 +++ .../.wasp/out/sdk/wasp/server/HttpError.ts} | 9 +- .../out/sdk/wasp/server}/_types/index.ts | 4 +- .../sdk/wasp/server}/_types/serialization.ts | 2 +- .../wasp/server}/_types/taggedEntities.ts | 2 +- .../config.js => sdk/wasp/server/config.ts} | 33 +- .../.wasp/out/sdk/wasp/server/dbClient.ts | 13 + .../.wasp/out/sdk/wasp/server/index.ts | 15 + .../server/middleware/globalMiddleware.ts | 8 + .../out/sdk/wasp/server/middleware/index.ts | 1 + .../wasp/server/operations/actions/index.ts | 2 + .../wasp/server/operations/actions/types.ts | 4 + .../out/sdk/wasp/server/operations/index.ts | 4 + .../wasp/server/operations/queries/index.ts | 2 + .../wasp/server/operations/queries/types.ts | 5 + .../src => sdk/wasp/server}/types/index.ts | 7 +- .../.wasp/out/sdk/wasp/server}/utils.ts | 30 - .../.wasp/out/sdk/wasp/tsconfig.json | 44 ++ .../.wasp/out/sdk/wasp}/universal/types.ts | 0 .../.wasp/out/sdk/wasp}/universal/url.ts | 0 .../out/sdk/wasp/universal/validators.ts | 21 + .../.wasp/out/sdk/wasp/vite-env.d.ts | 1 + .../waspCompile/.wasp/out/server/nodemon.json | 2 + .../waspCompile/.wasp/out/server/package.json | 33 +- .../.wasp/out/server/rollup.config.js | 24 + .../.wasp/out/server/scripts/validate-env.mjs | 2 +- .../.wasp/out/server/src/actions/types.ts | 2 +- .../waspCompile/.wasp/out/server/src/app.js | 2 +- .../.wasp/out/server/src/core/AuthError.js | 17 - .../.wasp/out/server/src/dbClient.ts | 12 - .../.wasp/out/server/src/dbSeed/types.ts | 3 - .../server/src/middleware/globalMiddleware.ts | 8 +- .../out/server/src/middleware/operations.ts | 2 +- .../.wasp/out/server/src/queries/types.ts | 2 +- .../.wasp/out/server/src/server.ts | 2 +- .../.wasp/out/server/tsconfig.json | 33 +- .../.wasp/out/web-app/package.json | 17 +- .../.wasp/out/web-app/public/.gitkeep | 0 .../out/web-app/scripts/validate-env.mjs | 2 +- .../out/web-app/src/ext-src/vite-env.d.ts | 1 - .../.wasp/out/web-app/src/index.tsx | 2 +- .../.wasp/out/web-app/src/queries/index.d.ts | 10 - .../.wasp/out/web-app/src/queries/index.js | 18 - .../.wasp/out/web-app/src/router.tsx | 26 +- .../out/web-app/src/test/vitest/setup.ts | 10 +- .../.wasp/out/web-app/tsconfig.json | 14 +- .../.wasp/out/web-app/vite.config.ts | 25 +- .../waspCompile/{src => }/.waspignore | 0 .../waspCompile-golden/waspCompile/main.wasp | 2 +- .../waspCompile/package.json | 13 + .../waspCompile/public/.gitkeep | 0 .../waspCompile/src/{client => }/Main.css | 0 .../waspCompile/src}/MainPage.jsx | 13 +- .../waspCompile/src/client/tsconfig.json | 55 -- .../waspCompile/src/client/vite-env.d.ts | 1 - .../waspCompile/src/server/tsconfig.json | 48 -- .../waspCompile/src/shared/tsconfig.json | 28 - .../waspCompile/src/vite-env.d.ts | 1 + .../waspCompile/src/{client => }/waspLogo.png | Bin .../waspCompile/tsconfig.json | 34 + .../waspCompile}/vite.config.ts | 0 .../waspComplexTest-golden/files.manifest | 528 ++++++++++--- .../waspComplexTest/.wasp/out/.waspchecksums | 722 +++++++++++------- .../waspComplexTest/.wasp/out/Dockerfile | 47 +- .../waspComplexTest/.wasp/out/db/package.json | 8 - .../.wasp/out/db/schema.prisma | 1 - .../db/schema.prisma.wasp-generate-checksum | 2 +- .../installedFullStackNpmDependencies.json | 1 - .../.wasp/out/installedNpmDepsLog.json | 1 + .../{web-app/src => sdk/wasp}/api/events.ts | 0 .../.wasp/out/sdk/wasp/api/index.ts} | 16 +- .../src => sdk/wasp}/auth/forms/Auth.tsx | 4 +- .../src => sdk/wasp}/auth/forms/Login.tsx | 1 + .../src => sdk/wasp}/auth/forms/Signup.tsx | 1 + .../wasp}/auth/forms/internal/Form.tsx | 9 +- .../wasp}/auth/forms/internal/Message.tsx | 5 +- .../forms/internal/common/LoginSignupForm.tsx | 6 +- .../forms/internal/social/SocialButton.tsx | 3 +- .../forms/internal/social/SocialIcons.tsx | 2 + .../src => sdk/wasp}/auth/forms/types.ts | 7 + .../wasp/auth/helpers/Google.tsx} | 4 +- .../src => sdk/wasp}/auth/helpers/user.ts | 5 +- .../.wasp/out/sdk/wasp/auth/index.ts | 4 + .../out/{server/src => sdk/wasp}/auth/jwt.ts | 4 +- .../{web-app/src => sdk/wasp}/auth/logout.ts | 5 +- .../{server/src => sdk/wasp}/auth/lucia.ts | 6 +- .../{server/src => sdk/wasp}/auth/password.ts | 2 + .../src => sdk/wasp}/auth/providers/types.ts | 16 +- .../{server/src => sdk/wasp}/auth/session.ts | 16 +- .../.wasp/out/sdk/wasp/auth/types.ts | 2 + .../{web-app/src => sdk/wasp}/auth/useAuth.ts | 14 +- .../.wasp/out/sdk/wasp/auth/user.ts | 27 + .../{server/src => sdk/wasp}/auth/utils.ts | 33 +- .../src => sdk/wasp}/auth/validation.ts | 8 +- .../.wasp/out/sdk/wasp/client/auth/google.ts | 2 + .../.wasp/out/sdk/wasp/client/auth/index.ts | 8 + .../.wasp/out/sdk/wasp/client/auth/ui.ts | 12 + .../.wasp/out/sdk/wasp/client/crud/index.ts | 1 + .../src => sdk/wasp/client}/crud/tasks.ts | 10 +- .../src/types.ts => sdk/wasp/client/index.ts} | 2 + .../wasp/client/operations}/actions/core.d.ts | 5 +- .../wasp/client/operations}/actions/core.js | 7 +- .../wasp/client/operations/actions/index.ts | 8 + .../out/sdk/wasp/client/operations/core.ts} | 223 ++++-- .../out/sdk/wasp/client/operations/index.ts | 22 + .../wasp/client/operations/internal}/index.ts | 9 +- .../client/operations/internal}/resources.js | 4 +- .../operations/internal}/updateHandlersMap.js | 0 .../wasp/client/operations}/queries/core.d.ts | 16 +- .../wasp/client/operations}/queries/core.js | 13 +- .../wasp/client/operations/queries/index.ts | 11 + .../sdk/wasp/client/operations/queryClient.ts | 34 + .../src => sdk/wasp/client}/router/Link.tsx | 3 +- .../.wasp/out/sdk/wasp/client/router/index.ts | 22 + .../wasp/client}/router/linkHelpers.ts | 1 + .../out/sdk/wasp/client}/router/types.ts | 5 + .../src => sdk/wasp/client}/test/index.ts | 0 .../sdk/wasp/client}/test/vitest/helpers.tsx | 12 +- .../core/auth.js => sdk/wasp/core/auth.ts} | 9 +- .../.wasp/out/sdk/wasp/core/config.ts} | 2 +- .../wasp/core/stitches.config.ts} | 0 .../{web-app/src => sdk/wasp/core}/storage.ts | 0 .../.wasp/out/sdk/wasp/dev/index.ts | 17 + .../.wasp/out/sdk/wasp/dist/api/events.d.ts | 7 + .../.wasp/out/sdk/wasp/dist/api/events.js | 4 + .../.wasp/out/sdk/wasp/dist/api/events.js.map | 1 + .../.wasp/out/sdk/wasp/dist/api/index.d.ts | 15 + .../.wasp/out/sdk/wasp/dist/api/index.js | 96 +++ .../.wasp/out/sdk/wasp/dist/api/index.js.map | 1 + .../out/sdk/wasp/dist/auth/forms/Auth.d.ts | 14 + .../out/sdk/wasp/dist/auth/forms/Auth.jsx | 56 ++ .../out/sdk/wasp/dist/auth/forms/Auth.jsx.map | 1 + .../out/sdk/wasp/dist/auth/forms/Login.d.ts | 3 + .../out/sdk/wasp/dist/auth/forms/Login.jsx | 7 + .../sdk/wasp/dist/auth/forms/Login.jsx.map | 1 + .../out/sdk/wasp/dist/auth/forms/Signup.d.ts | 5 + .../out/sdk/wasp/dist/auth/forms/Signup.jsx | 7 + .../sdk/wasp/dist/auth/forms/Signup.jsx.map | 1 + .../wasp/dist/auth/forms/internal/Form.d.ts | 161 ++++ .../wasp/dist/auth/forms/internal/Form.jsx | 89 +++ .../dist/auth/forms/internal/Form.jsx.map | 1 + .../dist/auth/forms/internal/Message.d.ts | 113 +++ .../wasp/dist/auth/forms/internal/Message.jsx | 19 + .../dist/auth/forms/internal/Message.jsx.map | 1 + .../internal/common/LoginSignupForm.d.ts | 10 + .../forms/internal/common/LoginSignupForm.jsx | 98 +++ .../internal/common/LoginSignupForm.jsx.map | 1 + .../forms/internal/social/SocialButton.d.ts | 23 + .../forms/internal/social/SocialButton.jsx | 27 + .../internal/social/SocialButton.jsx.map | 1 + .../forms/internal/social/SocialIcons.d.ts | 3 + .../forms/internal/social/SocialIcons.jsx | 18 + .../forms/internal/social/SocialIcons.jsx.map | 1 + .../out/sdk/wasp/dist/auth/forms/types.d.ts | 28 + .../out/sdk/wasp/dist/auth/forms/types.js | 7 + .../out/sdk/wasp/dist/auth/forms/types.js.map | 1 + .../sdk/wasp/dist/auth/helpers/Google.d.ts | 3 + .../out/sdk/wasp/dist/auth/helpers/Google.jsx | 12 + .../sdk/wasp/dist/auth/helpers/Google.jsx.map | 1 + .../out/sdk/wasp/dist/auth/helpers/user.d.ts | 1 + .../out/sdk/wasp/dist/auth/helpers/user.js | 14 + .../sdk/wasp/dist/auth/helpers/user.js.map | 1 + .../.wasp/out/sdk/wasp/dist/auth/index.d.ts | 2 + .../.wasp/out/sdk/wasp/dist/auth/index.js | 2 + .../.wasp/out/sdk/wasp/dist/auth/index.js.map | 1 + .../.wasp/out/sdk/wasp/dist/auth/jwt.d.ts | 2 + .../.wasp/out/sdk/wasp/dist/auth/jwt.js | 11 + .../.wasp/out/sdk/wasp/dist/auth/jwt.js.map | 1 + .../.wasp/out/sdk/wasp/dist/auth/logout.d.ts | 1 + .../.wasp/out/sdk/wasp/dist/auth/logout.js | 18 + .../out/sdk/wasp/dist/auth/logout.js.map | 1 + .../.wasp/out/sdk/wasp/dist/auth/lucia.d.ts | 25 + .../.wasp/out/sdk/wasp/dist/auth/lucia.js | 38 + .../.wasp/out/sdk/wasp/dist/auth/lucia.js.map | 1 + .../out/sdk/wasp/dist/auth/password.d.ts | 2 + .../.wasp/out/sdk/wasp/dist/auth/password.js | 15 + .../out/sdk/wasp/dist/auth/password.js.map | 1 + .../sdk/wasp/dist/auth/providers/types.d.ts | 28 + .../out/sdk/wasp/dist/auth/providers/types.js | 5 + .../sdk/wasp/dist/auth/providers/types.js.map | 1 + .../.wasp/out/sdk/wasp/dist/auth/session.d.ts | 13 + .../.wasp/out/sdk/wasp/dist/auth/session.js | 72 ++ .../out/sdk/wasp/dist/auth/session.js.map | 1 + .../.wasp/out/sdk/wasp/dist/auth/types.d.ts | 1 + .../.wasp/out/sdk/wasp/dist/auth/types.js | 2 + .../.wasp/out/sdk/wasp/dist/auth/types.js.map | 1 + .../.wasp/out/sdk/wasp/dist/auth/useAuth.d.ts | 3 + .../.wasp/out/sdk/wasp/dist/auth/useAuth.js | 36 + .../out/sdk/wasp/dist/auth/useAuth.js.map | 1 + .../.wasp/out/sdk/wasp/dist/auth/user.d.ts | 5 + .../.wasp/out/sdk/wasp/dist/auth/user.js | 23 + .../.wasp/out/sdk/wasp/dist/auth/user.js.map | 1 + .../.wasp/out/sdk/wasp/dist/auth/utils.d.ts | 82 ++ .../.wasp/out/sdk/wasp/dist/auth/utils.js | 200 +++++ .../.wasp/out/sdk/wasp/dist/auth/utils.js.map | 1 + .../out/sdk/wasp/dist/auth/validation.d.ts | 7 + .../out/sdk/wasp/dist/auth/validation.js | 69 ++ .../out/sdk/wasp/dist/auth/validation.js.map | 1 + .../out/sdk/wasp/dist/client/auth/google.d.ts | 1 + .../out/sdk/wasp/dist/client/auth/google.js | 3 + .../sdk/wasp/dist/client/auth/google.js.map | 1 + .../out/sdk/wasp/dist/client/auth/index.d.ts | 4 + .../out/sdk/wasp/dist/client/auth/index.js | 5 + .../sdk/wasp/dist/client/auth/index.js.map | 1 + .../out/sdk/wasp/dist/client/auth/ui.d.ts | 5 + .../.wasp/out/sdk/wasp/dist/client/auth/ui.js | 6 + .../out/sdk/wasp/dist/client/auth/ui.js.map | 1 + .../out/sdk/wasp/dist/client/crud/index.d.ts | 1 + .../out/sdk/wasp/dist/client/crud/index.js | 2 + .../sdk/wasp/dist/client/crud/index.js.map | 1 + .../out/sdk/wasp/dist/client/crud/tasks.d.ts | 39 + .../out/sdk/wasp/dist/client/crud/tasks.js | 31 + .../sdk/wasp/dist/client/crud/tasks.js.map | 1 + .../.wasp/out/sdk/wasp/dist/client/index.d.ts | 10 + .../.wasp/out/sdk/wasp/dist/client/index.js | 10 + .../out/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 | 4 + .../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 | 2 + .../dist/client/operations/queries/index.js | 6 + .../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 + .../out/sdk/wasp/dist/client/router/Link.d.ts | 9 + .../out/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 + .../out/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 + .../out/sdk/wasp/dist/client/router/types.js | 2 + .../sdk/wasp/dist/client/router/types.js.map | 1 + .../out/sdk/wasp/dist/client/test/index.d.ts | 1 + .../out/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 + .../.wasp/out/sdk/wasp/dist/core/auth.d.ts | 14 + .../.wasp/out/sdk/wasp/dist/core/auth.js | 33 + .../.wasp/out/sdk/wasp/dist/core/auth.js.map | 1 + .../.wasp/out/sdk/wasp/dist/core/config.d.ts | 4 + .../.wasp/out/sdk/wasp/dist/core/config.js | 7 + .../out/sdk/wasp/dist/core/config.js.map | 1 + .../sdk/wasp/dist/core/stitches.config.d.ts | 94 +++ .../out/sdk/wasp/dist/core/stitches.config.js | 27 + .../sdk/wasp/dist/core/stitches.config.js.map | 1 + .../.wasp/out/sdk/wasp/dist/core/storage.d.ts | 8 + .../.wasp/out/sdk/wasp/dist/core/storage.js | 41 + .../out/sdk/wasp/dist/core/storage.js.map | 1 + .../.wasp/out/sdk/wasp/dist/dev/index.d.ts | 11 + .../.wasp/out/sdk/wasp/dist/dev/index.js | 16 + .../.wasp/out/sdk/wasp/dist/dev/index.js.map | 1 + .../out/sdk/wasp/dist/entities/index.d.ts | 4 + .../.wasp/out/sdk/wasp/dist/entities/index.js | 2 + .../out/sdk/wasp/dist/entities/index.js.map | 1 + .../out/sdk/wasp/dist/ext-src/MainPage.d.ts | 1 + .../out/sdk/wasp/dist/ext-src/MainPage.jsx | 29 + .../sdk/wasp/dist/ext-src/MainPage.jsx.map | 1 + .../out/sdk/wasp/dist/ext-src/client/App.d.ts | 3 + .../out/sdk/wasp/dist/ext-src/client/App.jsx | 7 + .../sdk/wasp/dist/ext-src/client/App.jsx.map | 1 + .../ext-src/client/myClientSetupCode.d.ts | 1 + .../dist/ext-src/client/myClientSetupCode.js | 4 + .../ext-src/client/myClientSetupCode.js.map | 1 + .../wasp/dist/ext-src/server/actions/bar.d.ts | 1 + .../wasp/dist/ext-src/server/actions/bar.js | 4 + .../dist/ext-src/server/actions/bar.js.map | 1 + .../dist/ext-src/server/apiNamespaces.d.ts | 2 + .../wasp/dist/ext-src/server/apiNamespaces.js | 4 + .../dist/ext-src/server/apiNamespaces.js.map | 1 + .../sdk/wasp/dist/ext-src/server/apis.d.ts | 5 + .../out/sdk/wasp/dist/ext-src/server/apis.js | 11 + .../sdk/wasp/dist/ext-src/server/apis.js.map | 1 + .../wasp/dist/ext-src/server/jobs/bar.d.ts | 1 + .../sdk/wasp/dist/ext-src/server/jobs/bar.js | 4 + .../wasp/dist/ext-src/server/jobs/bar.js.map | 1 + .../dist/ext-src/server/jobs/returnHello.d.ts | 4 + .../dist/ext-src/server/jobs/returnHello.js | 4 + .../ext-src/server/jobs/returnHello.js.map | 1 + .../ext-src/server/myServerSetupCode.d.ts | 1 + .../dist/ext-src/server/myServerSetupCode.js | 4 + .../ext-src/server/myServerSetupCode.js.map | 1 + .../wasp/dist/ext-src/server/queries/bar.d.ts | 1 + .../wasp/dist/ext-src/server/queries/bar.js | 4 + .../dist/ext-src/server/queries/bar.js.map | 1 + .../out/sdk/wasp/dist/server/HttpError.d.ts | 5 + .../out/sdk/wasp/dist/server/HttpError.js | 17 + .../out/sdk/wasp/dist/server/HttpError.js.map | 1 + .../sdk/wasp/dist/server/_types/index.d.ts | 41 + .../out/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 | 9 + .../wasp/dist/server/_types/taggedEntities.js | 2 + .../dist/server/_types/taggedEntities.js.map | 1 + .../out/sdk/wasp/dist/server/api/index.d.ts | 6 + .../out/sdk/wasp/dist/server/api/index.js | 2 + .../out/sdk/wasp/dist/server/api/index.js.map | 1 + .../out/sdk/wasp/dist/server/auth/index.d.ts | 3 + .../out/sdk/wasp/dist/server/auth/index.js | 4 + .../sdk/wasp/dist/server/auth/index.js.map | 1 + .../out/sdk/wasp/dist/server/config.d.ts | 18 + .../.wasp/out/sdk/wasp/dist/server/config.js | 41 + .../out/sdk/wasp/dist/server/config.js.map | 1 + .../out/sdk/wasp/dist/server/crud/index.d.ts | 1 + .../out/sdk/wasp/dist/server/crud/index.js | 2 + .../sdk/wasp/dist/server/crud/index.js.map | 1 + .../out/sdk/wasp/dist/server/crud/tasks.d.ts | 30 + .../out/sdk/wasp/dist/server/crud/tasks.js | 2 + .../sdk/wasp/dist/server/crud/tasks.js.map | 1 + .../out/sdk/wasp/dist/server/dbClient.d.ts | 3 + .../out/sdk/wasp/dist/server/dbClient.js | 8 + .../out/sdk/wasp/dist/server/dbClient.js.map | 1 + .../wasp/dist/server/email/core/helpers.d.ts | 6 + .../wasp/dist/server/email/core/helpers.js | 18 + .../dist/server/email/core/helpers.js.map | 1 + .../wasp/dist/server/email/core/index.d.ts} | 0 .../sdk/wasp/dist/server/email/core/index.js | 3 + .../wasp/dist/server/email/core/index.js.map | 1 + .../server/email/core/providers/sendgrid.d.ts | 2 + .../server/email/core/providers/sendgrid.js | 23 + .../email/core/providers/sendgrid.js.map | 1 + .../wasp/dist/server/email/core/types.d.ts | 35 + .../sdk/wasp/dist/server/email/core/types.js | 2 + .../wasp/dist/server/email/core/types.js.map | 1 + .../out/sdk/wasp/dist/server/email/index.d.ts | 2 + .../out/sdk/wasp/dist/server/email/index.js | 8 + .../sdk/wasp/dist/server/email/index.js.map | 1 + .../.wasp/out/sdk/wasp/dist/server/index.d.ts | 7 + .../.wasp/out/sdk/wasp/dist/server/index.js | 7 + .../out/sdk/wasp/dist/server/index.js.map | 1 + .../sdk/wasp/dist/server/jobs/core/job.d.ts | 19 + .../out/sdk/wasp/dist/server/jobs/core/job.js | 22 + .../sdk/wasp/dist/server/jobs/core/job.js.map | 1 + .../dist/server/jobs/core/pgBoss/index.d.ts | 3 + .../dist/server/jobs/core/pgBoss/index.js | 3 + .../dist/server/jobs/core/pgBoss/index.js.map | 1 + .../dist/server/jobs/core/pgBoss/pgBoss.d.ts | 12 + .../dist/server/jobs/core/pgBoss/pgBoss.js | 67 ++ .../server/jobs/core/pgBoss/pgBoss.js.map | 1 + .../server/jobs/core/pgBoss/pgBossJob.d.ts | 71 ++ .../dist/server/jobs/core/pgBoss/pgBossJob.js | 93 +++ .../server/jobs/core/pgBoss/pgBossJob.js.map | 1 + .../dist/server/jobs/core/pgBoss/types.d.ts | 5 + .../dist/server/jobs/core/pgBoss/types.js | 2 + .../dist/server/jobs/core/pgBoss/types.js.map | 1 + .../out/sdk/wasp/dist/server/jobs/index.d.ts | 2 + .../out/sdk/wasp/dist/server/jobs/index.js | 3 + .../sdk/wasp/dist/server/jobs/index.js.map | 1 + .../wasp/dist/server/jobs/mySpecialJob.d.ts | 46 ++ .../sdk/wasp/dist/server/jobs/mySpecialJob.js | 10 + .../wasp/dist/server/jobs/mySpecialJob.js.map | 1 + .../wasp/dist/server/jobs/returnHelloJob.d.ts | 50 ++ .../wasp/dist/server/jobs/returnHelloJob.js | 13 + .../dist/server/jobs/returnHelloJob.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 | 3 + .../dist/server/operations/actions/index.js | 9 + .../server/operations/actions/index.js.map | 1 + .../dist/server/operations/actions/types.d.ts | 4 + .../dist/server/operations/actions/types.js | 2 + .../server/operations/actions/types.js.map | 1 + .../wasp/dist/server/operations/index.d.ts | 4 + .../sdk/wasp/dist/server/operations/index.js | 7 + .../wasp/dist/server/operations/index.js.map | 1 + .../dist/server/operations/queries/index.d.ts | 3 + .../dist/server/operations/queries/index.js | 9 + .../server/operations/queries/index.js.map | 1 + .../dist/server/operations/queries/types.d.ts | 4 + .../dist/server/operations/queries/types.js | 2 + .../server/operations/queries/types.js.map | 1 + .../out/sdk/wasp/dist/server/types/index.d.ts | 8 + .../out/sdk/wasp/dist/server/types/index.js | 2 + .../sdk/wasp/dist/server/types/index.js.map | 1 + .../.wasp/out/sdk/wasp/dist/server/utils.d.ts | 16 + .../.wasp/out/sdk/wasp/dist/server/utils.js | 17 + .../out/sdk/wasp/dist/server/utils.js.map | 1 + .../out/sdk/wasp/dist/universal/types.d.ts | 5 + .../out/sdk/wasp/dist/universal/types.js | 2 + .../out/sdk/wasp/dist/universal/types.js.map | 1 + .../out/sdk/wasp/dist/universal/url.d.ts | 1 + .../.wasp/out/sdk/wasp/dist/universal/url.js | 4 + .../out/sdk/wasp/dist/universal/url.js.map | 1 + .../sdk/wasp/dist/universal/validators.d.ts | 2 + .../sdk/wasp/dist/universal/validators.js} | 5 +- .../sdk/wasp/dist/universal/validators.js.map | 1 + .../src => sdk/wasp}/entities/index.ts | 0 .../src => sdk/wasp}/ext-src/Main.css | 0 .../.wasp/out/sdk/wasp/ext-src/MainPage.jsx | 41 + .../wasp/ext-src/client}/App.jsx | 0 .../wasp/ext-src/client}/myClientSetupCode.js | 0 .../wasp/ext-src/server}/actions/bar.js | 0 .../wasp/ext-src/server}/apiNamespaces.ts | 2 +- .../wasp/ext-src/server}/apis.ts | 4 +- .../wasp/ext-src/server}/jobs/bar.js | 0 .../wasp/ext-src/server}/jobs/returnHello.ts | 2 +- .../wasp/ext-src/server}/myServerSetupCode.js | 0 .../wasp/ext-src/server}/queries/bar.js | 0 .../.wasp/out/sdk/wasp/ext-src/vite-env.d.ts | 1 + .../src => sdk/wasp}/ext-src/waspLogo.png | Bin .../.wasp/out/sdk/wasp/package.json | 106 +++ .../.wasp/out/sdk/wasp/server/HttpError.ts} | 9 +- .../src => sdk/wasp/server}/_types/index.ts | 14 +- .../sdk/wasp/server}/_types/serialization.ts | 2 +- .../wasp/server}/_types/taggedEntities.ts | 2 +- .../types.ts => sdk/wasp/server/api/index.ts} | 10 +- .../.wasp/out/sdk/wasp/server/auth/index.ts | 25 + .../config.js => sdk/wasp/server/config.ts} | 36 +- .../.wasp/out/sdk/wasp/server/crud/index.ts | 2 + .../.wasp/out/sdk/wasp/server/crud/tasks.ts | 46 ++ .../.wasp/out/sdk/wasp/server/dbClient.ts | 10 + .../wasp/server}/email/core/helpers.ts | 2 + .../out/sdk/wasp/server/email/core/index.ts | 2 + .../server}/email/core/providers/sendgrid.ts | 3 +- .../wasp/server}/email/core/types.ts | 9 + .../src => sdk/wasp/server}/email/index.ts | 4 + .../.wasp/out/sdk/wasp/server/index.ts | 15 + .../src => sdk/wasp/server}/jobs/core/job.ts | 0 .../sdk/wasp/server/jobs/core/pgBoss/index.ts | 3 + .../wasp/server}/jobs/core/pgBoss/pgBoss.ts | 4 +- .../server}/jobs/core/pgBoss/pgBossJob.ts | 96 ++- .../sdk/wasp/server/jobs/core/pgBoss/types.ts | 9 + .../.wasp/out/sdk/wasp/server/jobs/index.ts | 3 + .../out/sdk/wasp/server/jobs/mySpecialJob.ts | 17 + .../sdk/wasp/server/jobs/returnHelloJob.ts | 18 + .../server/middleware/globalMiddleware.ts | 8 + .../out/sdk/wasp/server/middleware/index.ts | 1 + .../wasp/server/operations/actions/index.ts | 16 + .../wasp/server/operations/actions/types.ts | 16 + .../out/sdk/wasp/server/operations/index.ts | 8 + .../wasp/server/operations/queries/index.ts | 16 + .../wasp/server/operations/queries/types.ts | 17 + .../src => sdk/wasp/server}/types/index.ts | 7 +- .../.wasp/out/sdk/wasp/server}/utils.ts | 33 +- .../.wasp/out/sdk/wasp/tsconfig.json | 44 ++ .../.wasp/out/sdk/wasp}/universal/types.ts | 0 .../.wasp/out/sdk/wasp}/universal/url.ts | 0 .../out/sdk/wasp/universal/validators.ts | 21 + .../.wasp/out/sdk/wasp/vite-env.d.ts | 1 + .../.wasp/out/server/nodemon.json | 2 + .../.wasp/out/server/package.json | 39 +- .../out/server/patches/oauth+0.9.15.patch | 21 - .../.wasp/out/server/rollup.config.js | 24 + .../server/scripts/universal/validators.mjs | 21 - .../.wasp/out/server/scripts/validate-env.mjs | 2 +- ...{MySpecialAction.ts => mySpecialAction.ts} | 4 +- .../.wasp/out/server/src/actions/types.ts | 2 +- .../.wasp/out/server/src/app.js | 2 +- .../src/auth/providers/config/google.ts | 2 +- .../out/server/src/auth/providers/index.ts | 18 +- .../src/auth/providers/oauth/createRouter.ts | 13 +- .../server/src/auth/providers/oauth/init.ts | 4 +- .../server/src/auth/providers/oauth/types.ts | 2 +- .../.wasp/out/server/src/auth/user.ts | 27 - .../.wasp/out/server/src/core/AuthError.js | 17 - .../.wasp/out/server/src/crud/tasks.ts | 30 +- .../.wasp/out/server/src/dbClient.ts | 12 - .../.wasp/out/server/src/dbSeed/types.ts | 3 - .../.wasp/out/server/src/jobs/MySpecialJob.ts | 17 - .../out/server/src/jobs/ReturnHelloJob.ts | 18 - .../.wasp/out/server/src/jobs/core/allJobs.ts | 6 +- .../.wasp/out/server/src/jobs/mySpecialJob.ts | 8 + .../out/server/src/jobs/returnHelloJob.ts | 8 + .../server/src/middleware/globalMiddleware.ts | 8 +- .../out/server/src/middleware/operations.ts | 2 +- .../{MySpecialQuery.ts => mySpecialQuery.ts} | 4 +- .../.wasp/out/server/src/queries/types.ts | 2 +- .../.wasp/out/server/src/routes/apis/index.ts | 18 +- .../.wasp/out/server/src/routes/auth/index.js | 2 +- .../out/server/src/routes/auth/logout.ts | 6 +- .../.wasp/out/server/src/routes/auth/me.js | 4 +- .../.wasp/out/server/src/routes/crud/tasks.ts | 2 +- .../src/routes/operations/MySpecialAction.js | 4 - .../src/routes/operations/MySpecialQuery.js | 4 - .../out/server/src/routes/operations/index.js | 10 +- .../src/routes/operations/mySpecialAction.js | 4 + .../src/routes/operations/mySpecialQuery.js | 4 + .../.wasp/out/server/src/server.ts | 9 +- .../.wasp/out/server/src/utils.ts | 67 -- .../.wasp/out/server/tsconfig.json | 33 +- .../.wasp/out/web-app/package.json | 20 +- .../.wasp/out/web-app/public/.gitkeep | 0 .../web-app/scripts/universal/validators.mjs | 21 - .../out/web-app/scripts/validate-env.mjs | 2 +- .../web-app/src/actions/MySpecialAction.ts | 9 - .../src/auth/pages/OAuthCodeExchange.jsx | 6 +- .../src/auth/pages/createAuthRequiredPage.jsx | 2 +- .../.wasp/out/web-app/src/auth/types.ts | 2 - .../.wasp/out/web-app/src/auth/user.ts | 27 - .../out/web-app/src/ext-src/MainPage.jsx | 40 - .../out/web-app/src/ext-src/vite-env.d.ts | 1 - .../.wasp/out/web-app/src/index.tsx | 4 +- .../out/web-app/src/queries/MySpecialQuery.ts | 10 - .../.wasp/out/web-app/src/queries/index.d.ts | 10 - .../.wasp/out/web-app/src/queries/index.js | 18 - .../.wasp/out/web-app/src/router.tsx | 28 +- .../out/web-app/src/test/vitest/setup.ts | 10 +- .../.wasp/out/web-app/src/universal/types.ts | 31 - .../.wasp/out/web-app/src/universal/url.ts | 3 - .../.wasp/out/web-app/tsconfig.json | 14 +- .../.wasp/out/web-app/vite.config.ts | 25 +- .../waspComplexTest/{src => }/.waspignore | 0 .../waspComplexTest/main.wasp | 37 +- .../waspComplexTest/package.json | 15 + .../waspComplexTest/public/.gitkeep | 0 .../waspComplexTest/src/{client => }/Main.css | 0 .../waspComplexTest/src/MainPage.jsx | 41 + .../waspComplexTest/src/client/MainPage.jsx | 40 - .../waspComplexTest/src/client/tsconfig.json | 55 -- .../waspComplexTest/src/client/vite-env.d.ts | 1 - .../src/server/apiNamespaces.ts | 2 +- .../waspComplexTest/src/server/apis.ts | 4 +- .../src/server/jobs/returnHello.ts | 2 +- .../waspComplexTest/src/server/tsconfig.json | 48 -- .../waspComplexTest/src/shared/tsconfig.json | 28 - .../waspComplexTest/src/vite-env.d.ts | 1 + .../src/{client => }/waspLogo.png | Bin .../waspComplexTest/tsconfig.json | 34 + .../waspComplexTest}/vite.config.ts | 0 .../waspJob-golden/files.manifest | 282 +++++-- .../waspJob/.wasp/out/.waspchecksums | 443 +++++++---- .../waspJob/.wasp/out/Dockerfile | 43 +- .../waspJob/.wasp/out/db/schema.prisma | 1 - .../installedFullStackNpmDependencies.json | 1 - .../.wasp/out/installedNpmDepsLog.json | 1 + .../{web-app/src => sdk/wasp}/api/events.ts | 0 .../waspJob/.wasp/out/sdk/wasp/api/index.ts} | 16 +- .../src/types.ts => sdk/wasp/client/index.ts} | 2 + .../wasp/client/operations}/actions/core.d.ts | 5 +- .../wasp/client/operations}/actions/core.js | 7 +- .../wasp/client/operations/actions/index.ts | 1 + .../out/sdk/wasp/client/operations/core.ts} | 223 ++++-- .../out/sdk/wasp/client/operations/index.ts | 22 + .../wasp/client/operations/internal}/index.ts | 9 +- .../client/operations/internal}/resources.js | 4 +- .../operations/internal}/updateHandlersMap.js | 0 .../wasp/client/operations}/queries/core.d.ts | 16 +- .../wasp/client/operations}/queries/core.js | 13 +- .../wasp/client/operations/queries/index.ts | 4 + .../sdk/wasp/client/operations/queryClient.ts | 34 + .../src => sdk/wasp/client}/router/Link.tsx | 3 +- .../.wasp/out/sdk/wasp/client/router/index.ts | 22 + .../wasp/client}/router/linkHelpers.ts | 1 + .../out/sdk/wasp/client}/router/types.ts | 5 + .../src => sdk/wasp/client}/test/index.ts | 0 .../sdk/wasp/client}/test/vitest/helpers.tsx | 12 +- .../.wasp/out/sdk/wasp/core/config.ts} | 2 +- .../{web-app/src => sdk/wasp/core}/storage.ts | 0 .../waspJob/.wasp/out/sdk/wasp/dev/index.ts | 17 + .../.wasp/out/sdk/wasp/dist/api/events.d.ts | 7 + .../.wasp/out/sdk/wasp/dist/api/events.js | 4 + .../.wasp/out/sdk/wasp/dist/api/events.js.map | 1 + .../.wasp/out/sdk/wasp/dist/api/index.d.ts | 15 + .../.wasp/out/sdk/wasp/dist/api/index.js | 96 +++ .../.wasp/out/sdk/wasp/dist/api/index.js.map | 1 + .../.wasp/out/sdk/wasp/dist/client/index.d.ts | 10 + .../.wasp/out/sdk/wasp/dist/client/index.js | 10 + .../out/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 + .../out/sdk/wasp/dist/client/router/Link.d.ts | 8 + .../out/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 + .../out/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 + .../out/sdk/wasp/dist/client/router/types.js | 2 + .../sdk/wasp/dist/client/router/types.js.map | 1 + .../out/sdk/wasp/dist/client/test/index.d.ts | 1 + .../out/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 + .../.wasp/out/sdk/wasp/dist/core/config.d.ts | 4 + .../.wasp/out/sdk/wasp/dist/core/config.js | 7 + .../out/sdk/wasp/dist/core/config.js.map | 1 + .../.wasp/out/sdk/wasp/dist/core/storage.d.ts | 8 + .../.wasp/out/sdk/wasp/dist/core/storage.js | 41 + .../out/sdk/wasp/dist/core/storage.js.map | 1 + .../.wasp/out/sdk/wasp/dist/dev/index.d.ts | 11 + .../.wasp/out/sdk/wasp/dist/dev/index.js | 16 + .../.wasp/out/sdk/wasp/dist/dev/index.js.map | 1 + .../out/sdk/wasp/dist/entities/index.d.ts | 3 + .../.wasp/out/sdk/wasp/dist/entities/index.js | 2 + .../out/sdk/wasp/dist/entities/index.js.map | 1 + .../out/sdk/wasp/dist/ext-src/MainPage.d.ts | 1 + .../out/sdk/wasp/dist/ext-src/MainPage.jsx | 29 + .../sdk/wasp/dist/ext-src/MainPage.jsx.map | 1 + .../wasp/dist/ext-src/server/jobs/bar.d.ts | 1 + .../sdk/wasp/dist/ext-src/server/jobs/bar.js | 4 + .../wasp/dist/ext-src/server/jobs/bar.js.map | 1 + .../out/sdk/wasp/dist/server/HttpError.d.ts | 5 + .../out/sdk/wasp/dist/server/HttpError.js | 17 + .../out/sdk/wasp/dist/server/HttpError.js.map | 1 + .../sdk/wasp/dist/server/_types/index.d.ts | 18 + .../out/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 + .../out/sdk/wasp/dist/server/config.d.ts | 15 + .../.wasp/out/sdk/wasp/dist/server/config.js | 32 + .../out/sdk/wasp/dist/server/config.js.map | 1 + .../out/sdk/wasp/dist/server/dbClient.d.ts | 2 + .../out/sdk/wasp/dist/server/dbClient.js | 12 + .../out/sdk/wasp/dist/server/dbClient.js.map | 1 + .../.wasp/out/sdk/wasp/dist/server/index.d.ts | 7 + .../.wasp/out/sdk/wasp/dist/server/index.js | 7 + .../out/sdk/wasp/dist/server/index.js.map | 1 + .../sdk/wasp/dist/server/jobs/core/job.d.ts | 19 + .../out/sdk/wasp/dist/server/jobs/core/job.js | 22 + .../sdk/wasp/dist/server/jobs/core/job.js.map | 1 + .../dist/server/jobs/core/pgBoss/index.d.ts | 3 + .../dist/server/jobs/core/pgBoss/index.js | 3 + .../dist/server/jobs/core/pgBoss/index.js.map | 1 + .../dist/server/jobs/core/pgBoss/pgBoss.d.ts | 12 + .../dist/server/jobs/core/pgBoss/pgBoss.js | 67 ++ .../server/jobs/core/pgBoss/pgBoss.js.map | 1 + .../server/jobs/core/pgBoss/pgBossJob.d.ts | 71 ++ .../dist/server/jobs/core/pgBoss/pgBossJob.js | 93 +++ .../server/jobs/core/pgBoss/pgBossJob.js.map | 1 + .../dist/server/jobs/core/pgBoss/types.d.ts | 5 + .../dist/server/jobs/core/pgBoss/types.js | 2 + .../dist/server/jobs/core/pgBoss/types.js.map | 1 + .../out/sdk/wasp/dist/server/jobs/index.d.ts | 1 + .../out/sdk/wasp/dist/server/jobs/index.js | 2 + .../sdk/wasp/dist/server/jobs/index.js.map | 1 + .../wasp/dist/server/jobs/mySpecialJob.d.ts | 46 ++ .../sdk/wasp/dist/server/jobs/mySpecialJob.js | 10 + .../wasp/dist/server/jobs/mySpecialJob.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 + .../out/sdk/wasp/dist/server/types/index.d.ts | 8 + .../out/sdk/wasp/dist/server/types/index.js | 2 + .../sdk/wasp/dist/server/types/index.js.map | 1 + .../.wasp/out/sdk/wasp/dist/server/utils.d.ts | 12 + .../.wasp/out/sdk/wasp/dist/server/utils.js | 17 + .../out/sdk/wasp/dist/server/utils.js.map | 1 + .../out/sdk/wasp/dist/universal/types.d.ts | 5 + .../out/sdk/wasp/dist/universal/types.js | 2 + .../out/sdk/wasp/dist/universal/types.js.map | 1 + .../out/sdk/wasp/dist/universal/url.d.ts | 1 + .../.wasp/out/sdk/wasp/dist/universal/url.js | 4 + .../out/sdk/wasp/dist/universal/url.js.map | 1 + .../sdk/wasp/dist/universal/validators.d.ts | 2 + .../sdk/wasp/dist/universal/validators.js} | 5 +- .../sdk/wasp/dist/universal/validators.js.map | 1 + .../src => sdk/wasp}/entities/index.ts | 0 .../src => sdk/wasp}/ext-src/Main.css | 0 .../.wasp/out/sdk/wasp/ext-src/MainPage.jsx | 41 + .../wasp/ext-src/server}/jobs/bar.js | 0 .../.wasp/out/sdk/wasp/ext-src/vite-env.d.ts | 1 + .../src => sdk/wasp}/ext-src/waspLogo.png | Bin .../waspJob/.wasp/out/sdk/wasp/package.json | 102 +++ .../wasp/server/HttpError.ts} | 9 +- .../src => sdk/wasp/server}/_types/index.ts | 4 +- .../sdk/wasp/server}/_types/serialization.ts | 2 +- .../wasp/server}/_types/taggedEntities.ts | 2 +- .../config.js => sdk/wasp/server/config.ts} | 33 +- .../.wasp/out/sdk/wasp/server/dbClient.ts | 13 + .../.wasp/out/sdk/wasp/server/index.ts | 15 + .../src => sdk/wasp/server}/jobs/core/job.ts | 0 .../sdk/wasp/server/jobs/core/pgBoss/index.ts | 3 + .../wasp/server}/jobs/core/pgBoss/pgBoss.ts | 4 +- .../server}/jobs/core/pgBoss/pgBossJob.ts | 96 ++- .../sdk/wasp/server/jobs/core/pgBoss/types.ts | 9 + .../.wasp/out/sdk/wasp/server/jobs/index.ts | 2 + .../out/sdk/wasp/server/jobs/mySpecialJob.ts | 17 + .../server/middleware/globalMiddleware.ts | 8 + .../out/sdk/wasp/server/middleware/index.ts | 1 + .../wasp/server/operations/actions/index.ts | 2 + .../wasp/server/operations/actions/types.ts | 4 + .../out/sdk/wasp/server/operations/index.ts | 4 + .../wasp/server/operations/queries/index.ts | 2 + .../wasp/server/operations/queries/types.ts | 5 + .../src => sdk/wasp/server}/types/index.ts | 7 +- .../{server/src => sdk/wasp/server}/utils.ts | 30 - .../waspJob/.wasp/out/sdk/wasp/tsconfig.json | 44 ++ .../.wasp/out/sdk/wasp}/universal/types.ts | 0 .../.wasp/out/sdk/wasp}/universal/url.ts | 0 .../out/sdk/wasp/universal/validators.ts | 21 + .../waspJob/.wasp/out/sdk/wasp/vite-env.d.ts | 1 + .../waspJob/.wasp/out/server/nodemon.json | 2 + .../waspJob/.wasp/out/server/package.json | 34 +- .../waspJob/.wasp/out/server/rollup.config.js | 24 + .../server/scripts/universal/validators.mjs | 21 - .../.wasp/out/server/scripts/validate-env.mjs | 2 +- .../.wasp/out/server/src/actions/types.ts | 2 +- .../waspJob/.wasp/out/server/src/app.js | 2 +- .../.wasp/out/server/src/core/AuthError.js | 17 - .../waspJob/.wasp/out/server/src/dbClient.ts | 12 - .../.wasp/out/server/src/dbSeed/types.ts | 3 - .../.wasp/out/server/src/jobs/MySpecialJob.ts | 17 - .../.wasp/out/server/src/jobs/core/allJobs.ts | 4 +- .../.wasp/out/server/src/jobs/mySpecialJob.ts | 8 + .../server/src/middleware/globalMiddleware.ts | 8 +- .../out/server/src/middleware/operations.ts | 2 +- .../.wasp/out/server/src/queries/types.ts | 2 +- .../waspJob/.wasp/out/server/src/server.ts | 4 +- .../.wasp/out/server/src/universal/types.ts | 31 - .../.wasp/out/server/src/universal/url.ts | 3 - .../waspJob/.wasp/out/server/tsconfig.json | 33 +- .../waspJob/.wasp/out/web-app/package.json | 17 +- .../waspJob/.wasp/out/web-app/public/.gitkeep | 0 .../web-app/scripts/universal/validators.mjs | 21 - .../out/web-app/scripts/validate-env.mjs | 2 +- .../out/web-app/src/ext-src/MainPage.jsx | 40 - .../out/web-app/src/ext-src/vite-env.d.ts | 1 - .../out/web-app/src/ext-src/vite.config.ts | 7 - .../waspJob/.wasp/out/web-app/src/index.tsx | 2 +- .../.wasp/out/web-app/src/queries/index.d.ts | 10 - .../.wasp/out/web-app/src/queries/index.js | 18 - .../waspJob/.wasp/out/web-app/src/router.tsx | 26 +- .../out/web-app/src/test/vitest/setup.ts | 10 +- .../.wasp/out/web-app/src/universal/types.ts | 31 - .../.wasp/out/web-app/src/universal/url.ts | 3 - .../waspJob/.wasp/out/web-app/tsconfig.json | 14 +- .../waspJob/.wasp/out/web-app/vite.config.ts | 25 +- .../waspJob/{src => }/.waspignore | 0 .../waspJob-golden/waspJob/main.wasp | 6 +- .../waspJob-golden/waspJob/package.json | 13 + .../waspJob-golden/waspJob/public/.gitkeep | 0 .../waspJob/src/{client => }/Main.css | 0 .../waspJob-golden/waspJob/src/MainPage.jsx | 41 + .../waspJob/src/client/MainPage.jsx | 40 - .../waspJob/src/client/tsconfig.json | 55 -- .../waspJob/src/client/vite-env.d.ts | 1 - .../waspJob/src/client/vite.config.ts | 7 - .../waspJob/src/server/tsconfig.json | 48 -- .../waspJob/src/shared/tsconfig.json | 28 - .../waspJob-golden/waspJob/src/vite-env.d.ts | 1 + .../waspJob/src/{client => }/waspLogo.png | Bin .../waspJob-golden/waspJob/tsconfig.json | 34 + .../waspJob}/vite.config.ts | 0 .../waspMigrate-golden/files.manifest | 245 ++++-- .../waspMigrate/.wasp/out/.waspchecksums | 395 ++++++---- .../waspMigrate/.wasp/out/Dockerfile | 47 +- .../waspMigrate/.wasp/out/db/package.json | 8 - .../waspMigrate/.wasp/out/db/schema.prisma | 1 - .../db/schema.prisma.wasp-generate-checksum | 2 +- ...a.prisma.wasp-last-db-concurrence-checksum | 2 +- .../installedFullStackNpmDependencies.json | 1 - .../.wasp/out/installedNpmDepsLog.json | 1 + .../{web-app/src => sdk/wasp}/api/events.ts | 0 .../.wasp/out/sdk/wasp/api/index.ts | 108 +++ .../.wasp/out/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 + .../out/sdk/wasp/client/operations/core.ts | 346 +++++++++ .../out/sdk/wasp/client/operations/index.ts | 22 + .../wasp/client/operations/internal/index.ts | 25 + .../client/operations/internal/resources.js | 83 ++ .../operations/internal}/updateHandlersMap.js | 0 .../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 + .../.wasp/out/sdk/wasp/client/router/Link.tsx | 21 + .../.wasp/out/sdk/wasp/client/router/index.ts | 22 + .../out/sdk/wasp/client/router/linkHelpers.ts | 45 ++ .../.wasp/out/sdk/wasp/client/router/types.ts | 41 + .../src => sdk/wasp/client}/test/index.ts | 0 .../sdk/wasp/client/test/vitest/helpers.tsx | 95 +++ .../.wasp/out/sdk/wasp/core/config.ts | 9 + .../{web-app/src => sdk/wasp/core}/storage.ts | 0 .../.wasp/out/sdk/wasp/dev/index.ts | 17 + .../.wasp/out/sdk/wasp/dist/api/events.d.ts | 7 + .../.wasp/out/sdk/wasp/dist/api/events.js | 4 + .../.wasp/out/sdk/wasp/dist/api/events.js.map | 1 + .../.wasp/out/sdk/wasp/dist/api/index.d.ts | 15 + .../.wasp/out/sdk/wasp/dist/api/index.js | 96 +++ .../.wasp/out/sdk/wasp/dist/api/index.js.map | 1 + .../.wasp/out/sdk/wasp/dist/client/index.d.ts | 10 + .../.wasp/out/sdk/wasp/dist/client/index.js | 10 + .../out/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 + .../out/sdk/wasp/dist/client/router/Link.d.ts | 8 + .../out/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 + .../out/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 + .../out/sdk/wasp/dist/client/router/types.js | 2 + .../sdk/wasp/dist/client/router/types.js.map | 1 + .../out/sdk/wasp/dist/client/test/index.d.ts | 1 + .../out/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 + .../.wasp/out/sdk/wasp/dist/core/config.d.ts | 4 + .../.wasp/out/sdk/wasp/dist/core/config.js | 7 + .../out/sdk/wasp/dist/core/config.js.map | 1 + .../.wasp/out/sdk/wasp/dist/core/storage.d.ts | 8 + .../.wasp/out/sdk/wasp/dist/core/storage.js | 41 + .../out/sdk/wasp/dist/core/storage.js.map | 1 + .../.wasp/out/sdk/wasp/dist/dev/index.d.ts | 11 + .../.wasp/out/sdk/wasp/dist/dev/index.js | 16 + .../.wasp/out/sdk/wasp/dist/dev/index.js.map | 1 + .../out/sdk/wasp/dist/entities/index.d.ts | 4 + .../.wasp/out/sdk/wasp/dist/entities/index.js | 2 + .../out/sdk/wasp/dist/entities/index.js.map | 1 + .../out/sdk/wasp/dist/ext-src/MainPage.d.ts | 1 + .../out/sdk/wasp/dist/ext-src/MainPage.jsx | 29 + .../sdk/wasp/dist/ext-src/MainPage.jsx.map | 1 + .../out/sdk/wasp/dist/server/HttpError.d.ts | 5 + .../out/sdk/wasp/dist/server/HttpError.js | 17 + .../out/sdk/wasp/dist/server/HttpError.js.map | 1 + .../sdk/wasp/dist/server/_types/index.d.ts | 21 + .../out/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 | 7 + .../wasp/dist/server/_types/taggedEntities.js | 2 + .../dist/server/_types/taggedEntities.js.map | 1 + .../out/sdk/wasp/dist/server/config.d.ts | 15 + .../.wasp/out/sdk/wasp/dist/server/config.js | 32 + .../out/sdk/wasp/dist/server/config.js.map | 1 + .../out/sdk/wasp/dist/server/dbClient.d.ts | 3 + .../out/sdk/wasp/dist/server/dbClient.js | 8 + .../out/sdk/wasp/dist/server/dbClient.js.map | 1 + .../.wasp/out/sdk/wasp/dist/server/index.d.ts | 7 + .../.wasp/out/sdk/wasp/dist/server/index.js | 7 + .../out/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 + .../out/sdk/wasp/dist/server/types/index.d.ts | 8 + .../out/sdk/wasp/dist/server/types/index.js | 2 + .../sdk/wasp/dist/server/types/index.js.map | 1 + .../.wasp/out/sdk/wasp/dist/server/utils.d.ts | 12 + .../.wasp/out/sdk/wasp/dist/server/utils.js | 17 + .../out/sdk/wasp/dist/server/utils.js.map | 1 + .../out/sdk/wasp/dist/universal/types.d.ts | 5 + .../out/sdk/wasp/dist/universal/types.js | 2 + .../out/sdk/wasp/dist/universal/types.js.map | 1 + .../out/sdk/wasp/dist/universal/url.d.ts | 1 + .../.wasp/out/sdk/wasp/dist/universal/url.js | 4 + .../out/sdk/wasp/dist/universal/url.js.map | 1 + .../sdk/wasp/dist/universal/validators.d.ts | 2 + .../out/sdk/wasp/dist/universal/validators.js | 22 + .../sdk/wasp/dist/universal/validators.js.map | 1 + .../src => sdk/wasp}/entities/index.ts | 0 .../src => sdk/wasp}/ext-src/Main.css | 0 .../.wasp/out/sdk/wasp/ext-src/MainPage.jsx | 41 + .../.wasp/out/sdk/wasp/ext-src/vite-env.d.ts | 1 + .../src => sdk/wasp}/ext-src/waspLogo.png | Bin .../.wasp/out/sdk/wasp/package.json | 101 +++ .../.wasp/out/sdk/wasp/server/HttpError.ts | 23 + .../src => sdk/wasp/server}/_types/index.ts | 4 +- .../sdk/wasp/server/_types/serialization.ts | 43 ++ .../wasp/server}/_types/taggedEntities.ts | 2 +- .../.wasp/out/sdk/wasp/server/config.ts | 63 ++ .../.wasp/out/sdk/wasp/server/dbClient.ts | 10 + .../.wasp/out/sdk/wasp/server/index.ts | 15 + .../server/middleware/globalMiddleware.ts | 8 + .../out/sdk/wasp/server/middleware/index.ts | 1 + .../wasp/server/operations/actions/index.ts | 2 + .../wasp/server/operations/actions/types.ts | 4 + .../out/sdk/wasp/server/operations/index.ts | 4 + .../wasp/server/operations/queries/index.ts | 2 + .../wasp/server/operations/queries/types.ts | 5 + .../.wasp/out/sdk/wasp/server/types/index.ts | 11 + .../.wasp/out/sdk/wasp/server/utils.ts | 34 + .../.wasp/out/sdk/wasp/tsconfig.json | 44 ++ .../.wasp/out/sdk/wasp}/universal/types.ts | 0 .../.wasp/out/sdk/wasp}/universal/url.ts | 0 .../out/sdk/wasp/universal/validators.ts | 21 + .../.wasp/out/sdk/wasp/vite-env.d.ts | 1 + .../waspMigrate/.wasp/out/server/nodemon.json | 2 + .../waspMigrate/.wasp/out/server/package.json | 33 +- .../.wasp/out/server/rollup.config.js | 24 + .../server/scripts/universal/validators.mjs | 21 - .../.wasp/out/server/scripts/validate-env.mjs | 2 +- .../out/server/src/_types/serialization.ts | 43 -- .../.wasp/out/server/src/actions/types.ts | 2 +- .../waspMigrate/.wasp/out/server/src/app.js | 2 +- .../.wasp/out/server/src/config.js | 42 - .../.wasp/out/server/src/core/AuthError.js | 17 - .../.wasp/out/server/src/core/HttpError.js | 22 - .../.wasp/out/server/src/dbClient.ts | 12 - .../.wasp/out/server/src/dbSeed/types.ts | 3 - .../server/src/middleware/globalMiddleware.ts | 8 +- .../out/server/src/middleware/operations.ts | 2 +- .../.wasp/out/server/src/queries/types.ts | 2 +- .../.wasp/out/server/src/server.ts | 2 +- .../.wasp/out/server/src/types/index.ts | 14 - .../.wasp/out/server/src/universal/types.ts | 31 - .../.wasp/out/server/src/universal/url.ts | 3 - .../.wasp/out/server/tsconfig.json | 33 +- .../.wasp/out/web-app/package.json | 17 +- .../.wasp/out/web-app/public/.gitkeep | 0 .../web-app/scripts/universal/validators.mjs | 21 - .../out/web-app/scripts/validate-env.mjs | 2 +- .../.wasp/out/web-app/src/actions/core.d.ts | 13 - .../.wasp/out/web-app/src/actions/core.js | 35 - .../.wasp/out/web-app/src/actions/index.ts | 269 ------- .../waspMigrate/.wasp/out/web-app/src/api.ts | 104 --- .../.wasp/out/web-app/src/config.js | 9 - .../out/web-app/src/ext-src/MainPage.jsx | 40 - .../out/web-app/src/ext-src/vite-env.d.ts | 1 - .../out/web-app/src/ext-src/vite.config.ts | 7 - .../.wasp/out/web-app/src/index.tsx | 2 +- .../.wasp/out/web-app/src/operations/index.ts | 22 - .../out/web-app/src/operations/resources.js | 81 -- .../.wasp/out/web-app/src/queries/core.d.ts | 23 - .../.wasp/out/web-app/src/queries/core.js | 27 - .../.wasp/out/web-app/src/queries/index.d.ts | 10 - .../.wasp/out/web-app/src/queries/index.js | 18 - .../.wasp/out/web-app/src/router.tsx | 26 +- .../.wasp/out/web-app/src/router/Link.tsx | 20 - .../out/web-app/src/router/linkHelpers.ts | 44 -- .../.wasp/out/web-app/src/router/types.ts | 36 - .../out/web-app/src/test/vitest/helpers.tsx | 93 --- .../out/web-app/src/test/vitest/setup.ts | 10 +- .../.wasp/out/web-app/src/types.ts | 9 - .../.wasp/out/web-app/src/universal/types.ts | 31 - .../.wasp/out/web-app/src/universal/url.ts | 3 - .../.wasp/out/web-app/tsconfig.json | 14 +- .../.wasp/out/web-app/vite.config.ts | 25 +- .../waspMigrate/{src => }/.waspignore | 0 .../waspMigrate-golden/waspMigrate/main.wasp | 2 +- .../waspMigrate/package.json | 13 + .../waspMigrate/public/.gitkeep | 0 .../waspMigrate/src/{client => }/Main.css | 0 .../waspMigrate/src/MainPage.jsx | 41 + .../waspMigrate/src/client/MainPage.jsx | 40 - .../waspMigrate/src/client/tsconfig.json | 55 -- .../waspMigrate/src/client/vite-env.d.ts | 1 - .../waspMigrate/src/client/vite.config.ts | 7 - .../waspMigrate/src/server/tsconfig.json | 48 -- .../waspMigrate/src/shared/tsconfig.json | 28 - .../waspMigrate/src/vite-env.d.ts | 1 + .../waspMigrate/src/{client => }/waspLogo.png | Bin .../waspMigrate/tsconfig.json | 34 + .../waspMigrate}/vite.config.ts | 0 .../waspNew-golden/files.manifest | 18 +- .../waspNew/{src => }/.waspignore | 0 .../waspNew-golden/waspNew/main.wasp | 2 +- .../waspNew-golden/waspNew/package.json | 13 + .../waspNew-golden/waspNew/public/.gitkeep | 0 .../waspNew/src/{client => }/Main.css | 0 .../waspNew-golden/waspNew/src/MainPage.jsx | 41 + .../waspNew/src/client/MainPage.jsx | 40 - .../waspNew/src/client/tsconfig.json | 55 -- .../waspNew/src/client/vite-env.d.ts | 1 - .../waspNew/src/client/vite.config.ts | 7 - .../waspNew/src/server/tsconfig.json | 48 -- .../waspNew/src/shared/tsconfig.json | 28 - .../waspNew-golden/waspNew/src/vite-env.d.ts | 1 + .../waspNew/src/{client => }/waspLogo.png | Bin .../waspNew-golden/waspNew/tsconfig.json | 34 + .../waspNew}/vite.config.ts | 0 1488 files changed, 17261 insertions(+), 5555 deletions(-) delete mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedFullStackNpmDependencies.json create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedNpmDepsLog.json create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/rollup.config.js delete mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/core/AuthError.js delete mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/dbClient.ts delete mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/dbSeed/types.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/public/.gitkeep delete mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/ext-src/vite-env.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/queries/index.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/queries/index.js rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/{build/web-app/src => out/sdk/wasp}/api/events.ts (100%) rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/{build/web-app/src/api.ts => out/sdk/wasp/api/index.ts} (92%) rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/{build/web-app/src/types.ts => out/sdk/wasp/client/index.ts} (89%) rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src => waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations}/actions/core.d.ts (73%) rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src => waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations}/actions/core.js (90%) create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/actions/index.ts rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/{build/web-app/src/actions/index.ts => out/sdk/wasp/client/operations/core.ts} (64%) create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/index.ts rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/operations => waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/internal}/index.ts (81%) rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/operations => waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/internal}/resources.js (97%) rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/{build/web-app/src/operations => out/sdk/wasp/client/operations/internal}/updateHandlersMap.js (100%) rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/{build/web-app/src => out/sdk/wasp/client/operations}/queries/core.d.ts (63%) rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src => waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations}/queries/core.js (69%) create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/queries/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/queryClient.ts rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/web-app/src => waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client}/router/Link.tsx (91%) create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/index.ts rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/web-app/src => waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client}/router/linkHelpers.ts (98%) rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src => waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client}/router/types.ts (91%) rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/{build/web-app/src => out/sdk/wasp/client}/test/index.ts (100%) rename waspc/e2e-test/test-outputs/{waspJob-golden/waspJob/.wasp/out/web-app/src => waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client}/test/vitest/helpers.tsx (93%) rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/config.js => waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/core/config.ts} (72%) rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/{build/web-app/src => out/sdk/wasp/core}/storage.ts (100%) create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dev/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/events.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/events.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/events.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/core.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/Link.jsx create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/types.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/test/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/test/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/test/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/core/config.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/core/config.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/core/config.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/core/storage.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/core/storage.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/core/storage.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/dev/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/dev/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/dev/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/entities/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/entities/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/entities/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/serialization.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/dbClient.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/dbClient.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/types/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/types/index.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/types/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/utils.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/utils.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/utils.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/types.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/url.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/url.js create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/url.js.map create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/validators.d.ts rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/server/scripts/universal/validators.mjs => waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/validators.js} (91%) create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/validators.js.map rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/{build/server/src => out/sdk/wasp}/entities/index.ts (100%) rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/{build/web-app/src => out/sdk/wasp}/ext-src/Main.css (100%) rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/{src/client => .wasp/out/sdk/wasp/ext-src}/MainPage.jsx (81%) create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/{build/web-app/src => out/sdk/wasp}/ext-src/waspLogo.png (100%) create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/package.json rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/{build/server/src/core/HttpError.js => out/sdk/wasp/server/HttpError.ts} (67%) rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/server/src => waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server}/_types/index.ts (93%) rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/server/src => waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server}/_types/serialization.ts (95%) rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/{build/server/src => out/sdk/wasp/server}/_types/taggedEntities.ts (94%) rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/{build/server/src/config.js => out/sdk/wasp/server/config.ts} (59%) create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/dbClient.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/middleware/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/operations/actions/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/operations/actions/types.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/operations/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/operations/queries/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/operations/queries/types.ts rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/{build/server/src => out/sdk/wasp/server}/types/index.ts (73%) rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/server/src => waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server}/utils.ts (52%) create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/tsconfig.json rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/{build/server/src => out/sdk/wasp}/universal/types.ts (100%) rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/{build/server/src => out/sdk/wasp}/universal/url.ts (100%) create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/validators.ts create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/vite-env.d.ts rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/{src => }/.waspignore (100%) create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/package.json create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/public/.gitkeep rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/{client => }/Main.css (100%) rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/web-app/src/ext-src => waspBuild-golden/waspBuild/src}/MainPage.jsx (81%) delete mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/client/tsconfig.json delete mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/client/vite-env.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/server/tsconfig.json delete mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/shared/tsconfig.json create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/vite-env.d.ts rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/{client => }/waspLogo.png (100%) create mode 100644 waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/tsconfig.json rename waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/{.wasp/build/web-app/src/ext-src => }/vite.config.ts (100%) delete mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/installedFullStackNpmDependencies.json create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/installedNpmDepsLog.json rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/{web-app/src => sdk/wasp}/api/events.ts (100%) rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/{web-app/src/api.ts => sdk/wasp/api/index.ts} (92%) rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/{web-app/src/types.ts => sdk/wasp/client/index.ts} (89%) rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/{web-app/src => sdk/wasp/client/operations}/actions/core.d.ts (73%) rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/{web-app/src => sdk/wasp/client/operations}/actions/core.js (90%) create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/actions/index.ts rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/{web-app/src/actions/index.ts => sdk/wasp/client/operations/core.ts} (64%) create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/index.ts rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/{web-app/src/operations => sdk/wasp/client/operations/internal}/index.ts (81%) rename waspc/e2e-test/test-outputs/{waspJob-golden/waspJob/.wasp/out/web-app/src/operations => waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/internal}/resources.js (97%) rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/{web-app/src/operations => sdk/wasp/client/operations/internal}/updateHandlersMap.js (100%) rename waspc/e2e-test/test-outputs/{waspJob-golden/waspJob/.wasp/out/web-app/src => waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations}/queries/core.d.ts (63%) rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/{web-app/src => sdk/wasp/client/operations}/queries/core.js (69%) create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/queries/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/queryClient.ts rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/web-app/src => waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client}/router/Link.tsx (91%) create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/index.ts rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/web-app/src => waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client}/router/linkHelpers.ts (98%) rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/web-app/src => waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client}/router/types.ts (91%) rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/{web-app/src => sdk/wasp/client}/test/index.ts (100%) rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src => waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client}/test/vitest/helpers.tsx (93%) rename waspc/e2e-test/test-outputs/{waspJob-golden/waspJob/.wasp/out/web-app/src/config.js => waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/core/config.ts} (72%) rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/{web-app/src => sdk/wasp/core}/storage.ts (100%) create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dev/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/events.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/events.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/events.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/core.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/index.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/Link.jsx create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/index.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/types.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/index.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/config.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/config.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/config.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/storage.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/storage.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/storage.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/dev/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/dev/index.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/dev/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/entities/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/entities/index.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/entities/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/index.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/serialization.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/dbClient.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/dbClient.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/index.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/index.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/types/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/types/index.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/types/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/utils.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/utils.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/utils.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/types.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/url.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/url.js create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/url.js.map create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/validators.d.ts rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/server/scripts/universal/validators.mjs => waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/validators.js} (91%) create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/validators.js.map rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/{server/src => sdk/wasp}/entities/index.ts (100%) rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/{web-app/src => sdk/wasp}/ext-src/Main.css (100%) rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/{src/client => .wasp/out/sdk/wasp/ext-src}/MainPage.jsx (81%) create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/{web-app/src => sdk/wasp}/ext-src/waspLogo.png (100%) create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/package.json rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/core/HttpError.js => waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/HttpError.ts} (67%) rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/server/src => waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server}/_types/index.ts (93%) rename waspc/e2e-test/test-outputs/{waspJob-golden/waspJob/.wasp/out/server/src => waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server}/_types/serialization.ts (95%) rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/{server/src => sdk/wasp/server}/_types/taggedEntities.ts (94%) rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/{server/src/config.js => sdk/wasp/server/config.ts} (59%) create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/dbClient.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/middleware/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/operations/actions/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/operations/actions/types.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/operations/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/operations/queries/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/operations/queries/types.ts rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/{server/src => sdk/wasp/server}/types/index.ts (73%) rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/server/src => waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server}/utils.ts (52%) create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/tsconfig.json rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/web-app/src => waspCompile-golden/waspCompile/.wasp/out/sdk/wasp}/universal/types.ts (100%) rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/web-app/src => waspCompile-golden/waspCompile/.wasp/out/sdk/wasp}/universal/url.ts (100%) create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/validators.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/vite-env.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/rollup.config.js delete mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/core/AuthError.js delete mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/dbClient.ts delete mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/dbSeed/types.ts create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/public/.gitkeep delete mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/ext-src/vite-env.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/queries/index.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/queries/index.js rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/{src => }/.waspignore (100%) create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/package.json create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/public/.gitkeep rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/{client => }/Main.css (100%) rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/web-app/src/ext-src => waspCompile-golden/waspCompile/src}/MainPage.jsx (81%) delete mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/client/tsconfig.json delete mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/client/vite-env.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/server/tsconfig.json delete mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/shared/tsconfig.json create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/vite-env.d.ts rename waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/{client => }/waspLogo.png (100%) create mode 100644 waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/tsconfig.json rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/src/client => waspCompile-golden/waspCompile}/vite.config.ts (100%) delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/db/package.json delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/installedFullStackNpmDependencies.json create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/installedNpmDepsLog.json rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp}/api/events.ts (100%) rename waspc/e2e-test/test-outputs/{waspJob-golden/waspJob/.wasp/out/web-app/src/api.ts => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/api/index.ts} (92%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp}/auth/forms/Auth.tsx (96%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp}/auth/forms/Login.tsx (95%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp}/auth/forms/Signup.tsx (97%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp}/auth/forms/internal/Form.tsx (93%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp}/auth/forms/internal/Message.tsx (79%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp}/auth/forms/internal/common/LoginSignupForm.tsx (97%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp}/auth/forms/internal/social/SocialButton.tsx (90%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp}/auth/forms/internal/social/SocialIcons.tsx (98%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp}/auth/forms/types.ts (90%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src/auth/helpers/Google.jsx => sdk/wasp/auth/helpers/Google.tsx} (83%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp}/auth/helpers/user.ts (78%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/index.ts rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src => sdk/wasp}/auth/jwt.ts (82%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp}/auth/logout.ts (76%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src => sdk/wasp}/auth/lucia.ts (92%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src => sdk/wasp}/auth/password.ts (94%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src => sdk/wasp}/auth/providers/types.ts (90%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src => sdk/wasp}/auth/session.ts (88%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/types.ts rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp}/auth/useAuth.ts (73%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/user.ts rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src => sdk/wasp}/auth/utils.ts (95%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src => sdk/wasp}/auth/validation.ts (95%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/auth/google.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/auth/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/auth/ui.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/crud/index.ts rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp/client}/crud/tasks.ts (81%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src/types.ts => sdk/wasp/client/index.ts} (89%) rename waspc/e2e-test/test-outputs/{waspJob-golden/waspJob/.wasp/out/web-app/src => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations}/actions/core.d.ts (73%) rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/web-app/src => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations}/actions/core.js (90%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/actions/index.ts rename waspc/e2e-test/test-outputs/{waspJob-golden/waspJob/.wasp/out/web-app/src/actions/index.ts => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/core.ts} (64%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/index.ts rename waspc/e2e-test/test-outputs/{waspJob-golden/waspJob/.wasp/out/web-app/src/operations => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/internal}/index.ts (81%) rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/web-app/src/operations => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/internal}/resources.js (97%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src/operations => sdk/wasp/client/operations/internal}/updateHandlersMap.js (100%) rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/web-app/src => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations}/queries/core.d.ts (63%) rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/web-app/src => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations}/queries/core.js (69%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/queries/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/queryClient.ts rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp/client}/router/Link.tsx (91%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/router/index.ts rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp/client}/router/linkHelpers.ts (98%) rename waspc/e2e-test/test-outputs/{waspJob-golden/waspJob/.wasp/out/web-app/src => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client}/router/types.ts (91%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp/client}/test/index.ts (100%) rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/web-app/src => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client}/test/vitest/helpers.tsx (93%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src/core/auth.js => sdk/wasp/core/auth.ts} (81%) rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/web-app/src/config.js => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/core/config.ts} (72%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src/stitches.config.js => sdk/wasp/core/stitches.config.ts} (100%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp/core}/storage.ts (100%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dev/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/events.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/events.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/events.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Auth.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Auth.jsx create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Auth.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Login.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Login.jsx create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Login.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Signup.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Signup.jsx create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Signup.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.jsx create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.jsx create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.jsx create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialIcons.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialIcons.jsx create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialIcons.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/types.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/Google.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/Google.jsx create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/Google.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/user.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/user.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/user.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/jwt.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/jwt.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/jwt.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/logout.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/logout.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/logout.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/lucia.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/lucia.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/lucia.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/password.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/password.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/password.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/providers/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/providers/types.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/providers/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/types.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/google.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/google.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/google.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/ui.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/ui.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/ui.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/core.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/Link.jsx create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/types.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/config.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/config.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/config.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/storage.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/storage.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/storage.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/dev/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/dev/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/dev/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/entities/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/entities/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/entities/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/App.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/App.jsx create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/App.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/myClientSetupCode.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/myClientSetupCode.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/myClientSetupCode.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/actions/bar.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/actions/bar.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/actions/bar.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apiNamespaces.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apiNamespaces.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apiNamespaces.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apis.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apis.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apis.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/returnHello.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/returnHello.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/returnHello.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/myServerSetupCode.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/myServerSetupCode.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/myServerSetupCode.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/queries/bar.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/queries/bar.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/queries/bar.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/serialization.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/api/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/api/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/api/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/helpers.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/helpers.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/helpers.js.map rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src/email/core/index.ts => sdk/wasp/dist/server/email/core/index.d.ts} (100%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/providers/sendgrid.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/providers/sendgrid.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/providers/sendgrid.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/types.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/job.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/types/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/types/index.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/types/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.js.map create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/validators.d.ts rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/web-app/scripts/universal/validators.mjs => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/validators.js} (91%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/validators.js.map rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src => sdk/wasp}/entities/index.ts (100%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp}/ext-src/Main.css (100%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/MainPage.jsx rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src/ext-src => sdk/wasp/ext-src/client}/App.jsx (100%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src/ext-src => sdk/wasp/ext-src/client}/myClientSetupCode.js (100%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src/ext-src => sdk/wasp/ext-src/server}/actions/bar.js (100%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src/ext-src => sdk/wasp/ext-src/server}/apiNamespaces.ts (69%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src/ext-src => sdk/wasp/ext-src/server}/apis.ts (78%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src/ext-src => sdk/wasp/ext-src/server}/jobs/bar.js (100%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src/ext-src => sdk/wasp/ext-src/server}/jobs/returnHello.ts (64%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src/ext-src => sdk/wasp/ext-src/server}/myServerSetupCode.js (100%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src/ext-src => sdk/wasp/ext-src/server}/queries/bar.js (100%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{web-app/src => sdk/wasp}/ext-src/waspLogo.png (100%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/package.json rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/server/src/core/HttpError.js => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/HttpError.ts} (67%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src => sdk/wasp/server}/_types/index.ts (91%) rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/server/src => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server}/_types/serialization.ts (95%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src => sdk/wasp/server}/_types/taggedEntities.ts (96%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src/apis/types.ts => sdk/wasp/server/api/index.ts} (86%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/index.ts rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src/config.js => sdk/wasp/server/config.ts} (61%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/crud/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/crud/tasks.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/dbClient.ts rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src => sdk/wasp/server}/email/core/helpers.ts (94%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/core/index.ts rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src => sdk/wasp/server}/email/core/providers/sendgrid.ts (88%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src => sdk/wasp/server}/email/core/types.ts (85%) rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src => sdk/wasp/server}/email/index.ts (69%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/index.ts rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src => sdk/wasp/server}/jobs/core/job.ts (100%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/index.ts rename waspc/e2e-test/test-outputs/{waspJob-golden/waspJob/.wasp/out/server/src => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server}/jobs/core/pgBoss/pgBoss.ts (96%) rename waspc/e2e-test/test-outputs/{waspJob-golden/waspJob/.wasp/out/server/src => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server}/jobs/core/pgBoss/pgBossJob.ts (76%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/types.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/returnHelloJob.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/middleware/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/actions/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/actions/types.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/queries/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/queries/types.ts rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/{server/src => sdk/wasp/server}/types/index.ts (73%) rename waspc/e2e-test/test-outputs/{waspMigrate-golden/waspMigrate/.wasp/out/server/src => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server}/utils.ts (52%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/tsconfig.json rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/server/src => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp}/universal/types.ts (100%) rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/server/src => waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp}/universal/url.ts (100%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/validators.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/vite-env.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/patches/oauth+0.9.15.patch create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/rollup.config.js delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/scripts/universal/validators.mjs rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/actions/{MySpecialAction.ts => mySpecialAction.ts} (66%) delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/user.ts delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/core/AuthError.js delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/dbClient.ts delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/dbSeed/types.ts delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/MySpecialJob.ts delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/ReturnHelloJob.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/mySpecialJob.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/returnHelloJob.ts rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/queries/{MySpecialQuery.ts => mySpecialQuery.ts} (65%) delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/MySpecialAction.js delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/MySpecialQuery.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/mySpecialAction.js create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/mySpecialQuery.js delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/utils.ts create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/public/.gitkeep delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/scripts/universal/validators.mjs delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/actions/MySpecialAction.ts delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/types.ts delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/user.ts delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/MainPage.jsx delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/vite-env.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/MySpecialQuery.ts delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/index.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/index.js delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/universal/types.ts delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/universal/url.ts rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/{src => }/.waspignore (100%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/package.json create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/public/.gitkeep rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/{client => }/Main.css (100%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/MainPage.jsx delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/client/MainPage.jsx delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/client/tsconfig.json delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/client/vite-env.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/server/tsconfig.json delete mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/shared/tsconfig.json create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/vite-env.d.ts rename waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/{client => }/waspLogo.png (100%) create mode 100644 waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/tsconfig.json rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/web-app/src/ext-src => waspComplexTest-golden/waspComplexTest}/vite.config.ts (100%) delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/installedFullStackNpmDependencies.json create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/installedNpmDepsLog.json rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{web-app/src => sdk/wasp}/api/events.ts (100%) rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/api.ts => waspJob-golden/waspJob/.wasp/out/sdk/wasp/api/index.ts} (92%) rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{web-app/src/types.ts => sdk/wasp/client/index.ts} (89%) rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/web-app/src => waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations}/actions/core.d.ts (73%) rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{web-app/src => sdk/wasp/client/operations}/actions/core.js (90%) create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/actions/index.ts rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/actions/index.ts => waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/core.ts} (64%) create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/index.ts rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/web-app/src/operations => waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/internal}/index.ts (81%) rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/web-app/src/operations => waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/internal}/resources.js (97%) rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{web-app/src/operations => sdk/wasp/client/operations/internal}/updateHandlersMap.js (100%) rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src => waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations}/queries/core.d.ts (63%) rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{web-app/src => sdk/wasp/client/operations}/queries/core.js (69%) create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/queries/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/queryClient.ts rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{web-app/src => sdk/wasp/client}/router/Link.tsx (91%) create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/index.ts rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{web-app/src => sdk/wasp/client}/router/linkHelpers.ts (98%) rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/web-app/src => waspJob-golden/waspJob/.wasp/out/sdk/wasp/client}/router/types.ts (91%) rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{web-app/src => sdk/wasp/client}/test/index.ts (100%) rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/web-app/src => waspJob-golden/waspJob/.wasp/out/sdk/wasp/client}/test/vitest/helpers.tsx (93%) rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/web-app/src/config.js => waspJob-golden/waspJob/.wasp/out/sdk/wasp/core/config.ts} (72%) rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{web-app/src => sdk/wasp/core}/storage.ts (100%) create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dev/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/events.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/events.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/events.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/core.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/Link.jsx create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/types.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/config.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/config.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/config.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/storage.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/storage.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/storage.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/dev/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/dev/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/dev/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/entities/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/entities/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/entities/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/serialization.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/dbClient.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/dbClient.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/job.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/types/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/types/index.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/types/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/utils.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/utils.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/utils.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/types.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/url.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/url.js create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/url.js.map create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/validators.d.ts rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/web-app/scripts/universal/validators.mjs => waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/validators.js} (91%) create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/validators.js.map rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{server/src => sdk/wasp}/entities/index.ts (100%) rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{web-app/src => sdk/wasp}/ext-src/Main.css (100%) create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/ext-src/MainPage.jsx rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{server/src/ext-src => sdk/wasp/ext-src/server}/jobs/bar.js (100%) create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{web-app/src => sdk/wasp}/ext-src/waspLogo.png (100%) create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/package.json rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{server/src/core/HttpError.js => sdk/wasp/server/HttpError.ts} (67%) rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{server/src => sdk/wasp/server}/_types/index.ts (93%) rename waspc/e2e-test/test-outputs/{waspBuild-golden/waspBuild/.wasp/build/server/src => waspJob-golden/waspJob/.wasp/out/sdk/wasp/server}/_types/serialization.ts (95%) rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{server/src => sdk/wasp/server}/_types/taggedEntities.ts (94%) rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{server/src/config.js => sdk/wasp/server/config.ts} (59%) create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/dbClient.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/index.ts rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{server/src => sdk/wasp/server}/jobs/core/job.ts (100%) create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/index.ts rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/server/src => waspJob-golden/waspJob/.wasp/out/sdk/wasp/server}/jobs/core/pgBoss/pgBoss.ts (96%) rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/server/src => waspJob-golden/waspJob/.wasp/out/sdk/wasp/server}/jobs/core/pgBoss/pgBossJob.ts (76%) create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/types.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/middleware/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/operations/actions/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/operations/actions/types.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/operations/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/operations/queries/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/operations/queries/types.ts rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{server/src => sdk/wasp/server}/types/index.ts (73%) rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/{server/src => sdk/wasp/server}/utils.ts (52%) create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/tsconfig.json rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/web-app/src => waspJob-golden/waspJob/.wasp/out/sdk/wasp}/universal/types.ts (100%) rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/.wasp/out/web-app/src => waspJob-golden/waspJob/.wasp/out/sdk/wasp}/universal/url.ts (100%) create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/validators.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/vite-env.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/rollup.config.js delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/scripts/universal/validators.mjs delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/core/AuthError.js delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/dbClient.ts delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/dbSeed/types.ts delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/MySpecialJob.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/mySpecialJob.ts delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/universal/types.ts delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/universal/url.ts create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/public/.gitkeep delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/scripts/universal/validators.mjs delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/ext-src/MainPage.jsx delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/ext-src/vite-env.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/ext-src/vite.config.ts delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/queries/index.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/queries/index.js delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/universal/types.ts delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/universal/url.ts rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/{src => }/.waspignore (100%) create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/package.json create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/public/.gitkeep rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/{client => }/Main.css (100%) create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/MainPage.jsx delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/MainPage.jsx delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/tsconfig.json delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/vite-env.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/vite.config.ts delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/server/tsconfig.json delete mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/shared/tsconfig.json create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/vite-env.d.ts rename waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/{client => }/waspLogo.png (100%) create mode 100644 waspc/e2e-test/test-outputs/waspJob-golden/waspJob/tsconfig.json rename waspc/e2e-test/test-outputs/{waspCompile-golden/waspCompile/src/client => waspJob-golden/waspJob}/vite.config.ts (100%) delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/db/package.json delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/installedFullStackNpmDependencies.json create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/installedNpmDepsLog.json rename waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/{web-app/src => sdk/wasp}/api/events.ts (100%) create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/api/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/actions/core.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/actions/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/core.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/internal/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/internal/resources.js rename waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/{web-app/src/operations => sdk/wasp/client/operations/internal}/updateHandlersMap.js (100%) create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/queries/core.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/queries/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/queryClient.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/Link.tsx create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/linkHelpers.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/types.ts rename waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/{web-app/src => sdk/wasp/client}/test/index.ts (100%) create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/test/vitest/helpers.tsx create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/core/config.ts rename waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/{web-app/src => sdk/wasp/core}/storage.ts (100%) create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dev/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/events.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/events.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/events.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/core.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/index.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/Link.jsx create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/index.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/types.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/index.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/config.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/config.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/config.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/storage.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/storage.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/storage.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/dev/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/dev/index.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/dev/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/entities/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/entities/index.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/entities/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/index.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/serialization.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/index.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/index.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/types/index.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/types/index.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/types/index.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/utils.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/utils.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/utils.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.js.map create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/validators.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/validators.js create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/validators.js.map rename waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/{server/src => sdk/wasp}/entities/index.ts (100%) rename waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/{web-app/src => sdk/wasp}/ext-src/Main.css (100%) create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/ext-src/MainPage.jsx create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts rename waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/{web-app/src => sdk/wasp}/ext-src/waspLogo.png (100%) create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/package.json create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/HttpError.ts rename waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/{server/src => sdk/wasp/server}/_types/index.ts (93%) create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/_types/serialization.ts rename waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/{server/src => sdk/wasp/server}/_types/taggedEntities.ts (95%) create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/config.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/dbClient.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/middleware/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/operations/actions/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/operations/actions/types.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/operations/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/operations/queries/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/operations/queries/types.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/types/index.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/utils.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/tsconfig.json rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/server/src => waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp}/universal/types.ts (100%) rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/server/src => waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp}/universal/url.ts (100%) create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/validators.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/vite-env.d.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/rollup.config.js delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/scripts/universal/validators.mjs delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/_types/serialization.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/config.js delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/core/AuthError.js delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/core/HttpError.js delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/dbClient.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/dbSeed/types.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/types/index.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/universal/types.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/universal/url.ts create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/public/.gitkeep delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/scripts/universal/validators.mjs delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/actions/core.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/actions/core.js delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/actions/index.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/api.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/config.js delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/ext-src/MainPage.jsx delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/ext-src/vite-env.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/ext-src/vite.config.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/operations/index.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/operations/resources.js delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/queries/core.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/queries/core.js delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/queries/index.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/queries/index.js delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router/Link.tsx delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router/linkHelpers.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router/types.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/test/vitest/helpers.tsx delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/types.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/universal/types.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/universal/url.ts rename waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/{src => }/.waspignore (100%) create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/package.json create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/public/.gitkeep rename waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/{client => }/Main.css (100%) create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/MainPage.jsx delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/MainPage.jsx delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/tsconfig.json delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/vite-env.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/vite.config.ts delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/server/tsconfig.json delete mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/shared/tsconfig.json create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/vite-env.d.ts rename waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/{client => }/waspLogo.png (100%) create mode 100644 waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/tsconfig.json rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src => waspMigrate-golden/waspMigrate}/vite.config.ts (100%) rename waspc/e2e-test/test-outputs/waspNew-golden/waspNew/{src => }/.waspignore (100%) create mode 100644 waspc/e2e-test/test-outputs/waspNew-golden/waspNew/package.json create mode 100644 waspc/e2e-test/test-outputs/waspNew-golden/waspNew/public/.gitkeep rename waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/{client => }/Main.css (100%) create mode 100644 waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/MainPage.jsx delete mode 100644 waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/MainPage.jsx delete mode 100644 waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/tsconfig.json delete mode 100644 waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/vite-env.d.ts delete mode 100644 waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/vite.config.ts delete mode 100644 waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/server/tsconfig.json delete mode 100644 waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/shared/tsconfig.json create mode 100644 waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/vite-env.d.ts rename waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/{client => }/waspLogo.png (100%) create mode 100644 waspc/e2e-test/test-outputs/waspNew-golden/waspNew/tsconfig.json rename waspc/e2e-test/test-outputs/{waspComplexTest-golden/waspComplexTest/src/client => waspNew-golden/waspNew}/vite.config.ts (100%) diff --git a/waspc/e2e-test/ShellCommands.hs b/waspc/e2e-test/ShellCommands.hs index 6700e540bb..524128e399 100644 --- a/waspc/e2e-test/ShellCommands.hs +++ b/waspc/e2e-test/ShellCommands.hs @@ -15,7 +15,7 @@ module ShellCommands waspCliMigrate, waspCliBuild, dockerBuild, - insertCodeIntoWaspFileAtLineNumber, + insertCodeIntoFileAtLineNumber, ) where @@ -73,14 +73,14 @@ createFile content relDirFp filename = return $ combineShellCommands [createPare -- we do not have a `db` field. Consider better alternatives. setDbToPSQL :: ShellCommandBuilder ShellCommand -- Change DB to postgres by adding string at specific line so it still parses. -setDbToPSQL = insertCodeIntoWaspFileAtLineNumber 2 " db: { system: PostgreSQL }," +setDbToPSQL = insertCodeIntoFileAtLineNumber "main.wasp" 2 " db: { system: PostgreSQL }," -insertCodeIntoWaspFileAtLineNumber :: Int -> String -> ShellCommandBuilder ShellCommand -insertCodeIntoWaspFileAtLineNumber atLineNumber line = +insertCodeIntoFileAtLineNumber :: FilePath -> Int -> String -> ShellCommandBuilder ShellCommand +insertCodeIntoFileAtLineNumber fileName atLineNumber line = return $ combineShellCommands - [ "awk 'NR==" ++ show atLineNumber ++ "{print " ++ show line ++ "}1' main.wasp > main.wasp.tmp", - "mv main.wasp.tmp main.wasp" + [ "awk 'NR==" ++ show atLineNumber ++ "{print " ++ show line ++ "}1' " ++ fileName ++ " > " ++ fileName ++ ".tmp", + "mv " ++ fileName ++ ".tmp " ++ fileName ] waspCliNew :: ShellCommandBuilder ShellCommand diff --git a/waspc/e2e-test/Tests/WaspComplexTest.hs b/waspc/e2e-test/Tests/WaspComplexTest.hs index 025654d8f8..3a2a25b2b4 100644 --- a/waspc/e2e-test/Tests/WaspComplexTest.hs +++ b/waspc/e2e-test/Tests/WaspComplexTest.hs @@ -7,7 +7,7 @@ import ShellCommands appendToWaspFile, cdIntoCurrentProject, createFile, - insertCodeIntoWaspFileAtLineNumber, + insertCodeIntoFileAtLineNumber, setDbToPSQL, waspCliCompile, waspCliNew, @@ -54,8 +54,8 @@ addClientSetup = do clientField = unlines [ " client: {", - " setupFn: import myClientSetupFunction from \"@client/myClientSetupCode.js\",", - " rootComponent: import App from \"@client/App.jsx\"", + " setupFn: import myClientSetupFunction from \"@src/client/myClientSetupCode.js\",", + " rootComponent: import App from \"@src/client/App.jsx\"", " }," ] rootComponentContent = @@ -87,7 +87,7 @@ addServerSetup = do serverField = unlines [ " server: {", - " setupFn: import mySetupFunction from \"@server/myServerSetupCode.js\",", + " setupFn: import mySetupFunction from \"@src/server/myServerSetupCode.js\",", " }," ] serverSetupFnContent = @@ -106,10 +106,10 @@ addJob = do where jobDecl = unlines - [ "job MySpecialJob {", + [ "job mySpecialJob {", " executor: PgBoss,", " perform: {", - " fn: import { foo } from \"@server/jobs/bar.js\"", + " fn: import { foo } from \"@src/server/jobs/bar.js\"", " }", "}" ] @@ -130,10 +130,10 @@ addTsJob = do where jobDecl = unlines - [ "job ReturnHelloJob {", + [ "job returnHelloJob {", " executor: PgBoss,", " perform: {", - " fn: import { returnHello } from \"@server/jobs/returnHello.js\",", + " fn: import { returnHello } from \"@src/server/jobs/returnHello.js\",", " },", " entities: [User],", "}" @@ -141,7 +141,7 @@ addTsJob = do jobFile = unlines - [ "import { ReturnHelloJob } from '@wasp/jobs/ReturnHelloJob'", + [ "import { ReturnHelloJob } from 'wasp/server/jobs'", "export const returnHello: ReturnHelloJob<{ name: string }, string> = async (args) => {", " return args.name", "}" @@ -218,8 +218,8 @@ addAction = do where actionDecl = unlines - [ "action MySpecialAction {", - " fn: import { foo } from \"@server/actions/bar.js\",", + [ "action mySpecialAction {", + " fn: import { foo } from \"@src/server/actions/bar.js\",", " entities: [User],", "}" ] @@ -240,8 +240,8 @@ addQuery = do where queryDecl = unlines - [ "query MySpecialQuery {", - " fn: import { foo } from \"@server/queries/bar.js\",", + [ "query mySpecialQuery {", + " fn: import { foo } from \"@src/server/queries/bar.js\",", " entities: [User],", "}" ] @@ -256,15 +256,13 @@ addQuery = do addDependencies :: ShellCommandBuilder [ShellCommand] addDependencies = do sequence - [ insertCodeIntoWaspFileAfterVersion deps + [ insertCodeIntoPackageJsonIntoDependencies deps ] where deps = unlines - [ " dependencies: [", - " (\"redux\", \"^4.0.5\"),", - " (\"react-redux\", \"^7.1.3\")", - " ]," + [ " \"redux\": \"^4.0.5\",", + " \"react-redux\": \"^7.1.3\"," ] addApi :: ShellCommandBuilder [ShellCommand] @@ -277,12 +275,12 @@ addApi = do apiDecls = unlines [ "api fooBar {", - " fn: import { fooBar } from \"@server/apis.js\",", + " fn: import { fooBar } from \"@src/server/apis.js\",", " httpRoute: (GET, \"/foo/bar\"),", - " middlewareConfigFn: import { fooBarMiddlewareFn } from \"@server/apis.js\"", + " middlewareConfigFn: import { fooBarMiddlewareFn } from \"@src/server/apis.js\"", "}", "api fooBaz {", - " fn: import { fooBaz } from \"@server/apis.js\",", + " fn: import { fooBaz } from \"@src/server/apis.js\",", " httpRoute: (GET, \"/foo/baz\"),", " auth: false", "}" @@ -290,8 +288,8 @@ addApi = do apiFile = unlines - [ "import { FooBar, FooBaz } from '@wasp/apis/types'", - "import { MiddlewareConfigFn } from '@wasp/middleware'", + [ "import { FooBar, FooBaz } from 'wasp/server/api'", + "import { MiddlewareConfigFn } from 'wasp/server'", "export const fooBar: FooBar = (req, res, context) => {", " res.set('Access-Control-Allow-Origin', '*')", " res.json({ msg: 'Hello, context.user.username!' })", @@ -314,14 +312,14 @@ addApiNamespace = do apiNamespaceDecl = unlines [ "apiNamespace fooBarNamespace {", - " middlewareConfigFn: import { fooBarNamespaceMiddlewareFn } from \"@server/apiNamespaces.js\",", + " middlewareConfigFn: import { fooBarNamespaceMiddlewareFn } from \"@src/server/apiNamespaces.js\",", " path: \"/bar\"", "}" ] apiNamespaceFile = unlines - [ "import { MiddlewareConfigFn } from '@wasp/middleware'", + [ "import { MiddlewareConfigFn } from 'wasp/server'", "export const fooBarNamespaceMiddlewareFn: MiddlewareConfigFn = (middlewareConfig) => {", " return middlewareConfig", "}" @@ -372,7 +370,13 @@ addCrud = do ] insertCodeIntoWaspFileAfterVersion :: String -> ShellCommandBuilder ShellCommand -insertCodeIntoWaspFileAfterVersion = insertCodeIntoWaspFileAtLineNumber lineNumberInWaspFileAfterVersion +insertCodeIntoWaspFileAfterVersion = insertCodeIntoFileAtLineNumber "main.wasp" lineNumberInWaspFileAfterVersion where lineNumberInWaspFileAfterVersion :: Int lineNumberInWaspFileAfterVersion = 5 + +insertCodeIntoPackageJsonIntoDependencies :: String -> ShellCommandBuilder ShellCommand +insertCodeIntoPackageJsonIntoDependencies = insertCodeIntoFileAtLineNumber "package.json" lineNumberInPackageJsonDependencies + where + lineNumberInPackageJsonDependencies :: Int + lineNumberInPackageJsonDependencies = 3 diff --git a/waspc/e2e-test/Tests/WaspJobTest.hs b/waspc/e2e-test/Tests/WaspJobTest.hs index 66b5801ed8..00aa16179a 100644 --- a/waspc/e2e-test/Tests/WaspJobTest.hs +++ b/waspc/e2e-test/Tests/WaspJobTest.hs @@ -17,10 +17,10 @@ import Wasp.Project.Db (databaseUrlEnvVarName) waspJob :: GoldenTest waspJob = do let jobDecl = - " job MySpecialJob { \n\ + " job mySpecialJob { \n\ \ executor: PgBoss, \n\ \ perform: { \n\ - \ fn: import { foo } from \"@server/jobs/bar.js\" \n\ + \ fn: import { foo } from \"@src/server/jobs/bar.js\" \n\ \ } \n\ \ } \n" diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest b/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest index 5080925b79..b1c17f1d5b 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest @@ -2,24 +2,15 @@ waspBuild/.wasp/build/.dockerignore waspBuild/.wasp/build/.waspchecksums waspBuild/.wasp/build/Dockerfile waspBuild/.wasp/build/db/schema.prisma -waspBuild/.wasp/build/installedFullStackNpmDependencies.json +waspBuild/.wasp/build/installedNpmDepsLog.json waspBuild/.wasp/build/server/.npmrc waspBuild/.wasp/build/server/README.md waspBuild/.wasp/build/server/nodemon.json waspBuild/.wasp/build/server/package.json -waspBuild/.wasp/build/server/scripts/universal/validators.mjs +waspBuild/.wasp/build/server/rollup.config.js waspBuild/.wasp/build/server/scripts/validate-env.mjs -waspBuild/.wasp/build/server/src/_types/index.ts -waspBuild/.wasp/build/server/src/_types/serialization.ts -waspBuild/.wasp/build/server/src/_types/taggedEntities.ts waspBuild/.wasp/build/server/src/actions/types.ts waspBuild/.wasp/build/server/src/app.js -waspBuild/.wasp/build/server/src/config.js -waspBuild/.wasp/build/server/src/core/AuthError.js -waspBuild/.wasp/build/server/src/core/HttpError.js -waspBuild/.wasp/build/server/src/dbClient.ts -waspBuild/.wasp/build/server/src/dbSeed/types.ts -waspBuild/.wasp/build/server/src/entities/index.ts waspBuild/.wasp/build/server/src/middleware/globalMiddleware.ts waspBuild/.wasp/build/server/src/middleware/index.ts waspBuild/.wasp/build/server/src/middleware/operations.ts @@ -28,66 +19,215 @@ waspBuild/.wasp/build/server/src/queries/types.ts 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/src/types/index.ts -waspBuild/.wasp/build/server/src/universal/types.ts -waspBuild/.wasp/build/server/src/universal/url.ts -waspBuild/.wasp/build/server/src/utils.ts waspBuild/.wasp/build/server/tsconfig.json waspBuild/.wasp/build/web-app/.npmrc waspBuild/.wasp/build/web-app/README.md waspBuild/.wasp/build/web-app/index.html waspBuild/.wasp/build/web-app/netlify.toml waspBuild/.wasp/build/web-app/package.json +waspBuild/.wasp/build/web-app/public/.gitkeep waspBuild/.wasp/build/web-app/public/favicon.ico waspBuild/.wasp/build/web-app/public/manifest.json -waspBuild/.wasp/build/web-app/scripts/universal/validators.mjs waspBuild/.wasp/build/web-app/scripts/validate-env.mjs -waspBuild/.wasp/build/web-app/src/actions/core.d.ts -waspBuild/.wasp/build/web-app/src/actions/core.js -waspBuild/.wasp/build/web-app/src/actions/index.ts -waspBuild/.wasp/build/web-app/src/api.ts -waspBuild/.wasp/build/web-app/src/api/events.ts -waspBuild/.wasp/build/web-app/src/config.js waspBuild/.wasp/build/web-app/src/entities/index.ts -waspBuild/.wasp/build/web-app/src/ext-src/Main.css -waspBuild/.wasp/build/web-app/src/ext-src/MainPage.jsx -waspBuild/.wasp/build/web-app/src/ext-src/vite-env.d.ts -waspBuild/.wasp/build/web-app/src/ext-src/vite.config.ts -waspBuild/.wasp/build/web-app/src/ext-src/waspLogo.png waspBuild/.wasp/build/web-app/src/index.tsx waspBuild/.wasp/build/web-app/src/logo.png -waspBuild/.wasp/build/web-app/src/operations/index.ts -waspBuild/.wasp/build/web-app/src/operations/resources.js -waspBuild/.wasp/build/web-app/src/operations/updateHandlersMap.js -waspBuild/.wasp/build/web-app/src/queries/core.d.ts -waspBuild/.wasp/build/web-app/src/queries/core.js -waspBuild/.wasp/build/web-app/src/queries/index.d.ts -waspBuild/.wasp/build/web-app/src/queries/index.js waspBuild/.wasp/build/web-app/src/queryClient.js waspBuild/.wasp/build/web-app/src/router.tsx -waspBuild/.wasp/build/web-app/src/router/Link.tsx -waspBuild/.wasp/build/web-app/src/router/linkHelpers.ts -waspBuild/.wasp/build/web-app/src/router/types.ts -waspBuild/.wasp/build/web-app/src/storage.ts -waspBuild/.wasp/build/web-app/src/test/index.ts -waspBuild/.wasp/build/web-app/src/test/vitest/helpers.tsx waspBuild/.wasp/build/web-app/src/test/vitest/setup.ts -waspBuild/.wasp/build/web-app/src/types.ts -waspBuild/.wasp/build/web-app/src/universal/types.ts -waspBuild/.wasp/build/web-app/src/universal/url.ts waspBuild/.wasp/build/web-app/src/utils.js waspBuild/.wasp/build/web-app/src/vite-env.d.ts waspBuild/.wasp/build/web-app/tsconfig.json waspBuild/.wasp/build/web-app/tsconfig.node.json waspBuild/.wasp/build/web-app/vite.config.ts +waspBuild/.wasp/out/sdk/wasp/api/events.ts +waspBuild/.wasp/out/sdk/wasp/api/index.ts +waspBuild/.wasp/out/sdk/wasp/client/index.ts +waspBuild/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts +waspBuild/.wasp/out/sdk/wasp/client/operations/actions/core.js +waspBuild/.wasp/out/sdk/wasp/client/operations/actions/index.ts +waspBuild/.wasp/out/sdk/wasp/client/operations/core.ts +waspBuild/.wasp/out/sdk/wasp/client/operations/index.ts +waspBuild/.wasp/out/sdk/wasp/client/operations/internal/index.ts +waspBuild/.wasp/out/sdk/wasp/client/operations/internal/resources.js +waspBuild/.wasp/out/sdk/wasp/client/operations/internal/updateHandlersMap.js +waspBuild/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts +waspBuild/.wasp/out/sdk/wasp/client/operations/queries/core.js +waspBuild/.wasp/out/sdk/wasp/client/operations/queries/index.ts +waspBuild/.wasp/out/sdk/wasp/client/operations/queryClient.ts +waspBuild/.wasp/out/sdk/wasp/client/router/Link.tsx +waspBuild/.wasp/out/sdk/wasp/client/router/index.ts +waspBuild/.wasp/out/sdk/wasp/client/router/linkHelpers.ts +waspBuild/.wasp/out/sdk/wasp/client/router/types.ts +waspBuild/.wasp/out/sdk/wasp/client/test/index.ts +waspBuild/.wasp/out/sdk/wasp/client/test/vitest/helpers.tsx +waspBuild/.wasp/out/sdk/wasp/core/config.ts +waspBuild/.wasp/out/sdk/wasp/core/storage.ts +waspBuild/.wasp/out/sdk/wasp/dev/index.ts +waspBuild/.wasp/out/sdk/wasp/dist/api/events.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/api/events.js +waspBuild/.wasp/out/sdk/wasp/dist/api/events.js.map +waspBuild/.wasp/out/sdk/wasp/dist/api/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/api/index.js +waspBuild/.wasp/out/sdk/wasp/dist/api/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/client/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/index.js +waspBuild/.wasp/out/sdk/wasp/dist/client/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/core.js +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/core.js.map +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/index.js +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js +waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map +waspBuild/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/router/Link.jsx +waspBuild/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map +waspBuild/.wasp/out/sdk/wasp/dist/client/router/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/router/index.js +waspBuild/.wasp/out/sdk/wasp/dist/client/router/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js +waspBuild/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map +waspBuild/.wasp/out/sdk/wasp/dist/client/router/types.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/router/types.js +waspBuild/.wasp/out/sdk/wasp/dist/client/router/types.js.map +waspBuild/.wasp/out/sdk/wasp/dist/client/test/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/test/index.js +waspBuild/.wasp/out/sdk/wasp/dist/client/test/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx +waspBuild/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map +waspBuild/.wasp/out/sdk/wasp/dist/core/config.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/core/config.js +waspBuild/.wasp/out/sdk/wasp/dist/core/config.js.map +waspBuild/.wasp/out/sdk/wasp/dist/core/storage.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/core/storage.js +waspBuild/.wasp/out/sdk/wasp/dist/core/storage.js.map +waspBuild/.wasp/out/sdk/wasp/dist/dev/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/dev/index.js +waspBuild/.wasp/out/sdk/wasp/dist/dev/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/entities/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/entities/index.js +waspBuild/.wasp/out/sdk/wasp/dist/entities/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx +waspBuild/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map +waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js +waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js.map +waspBuild/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/server/_types/index.js +waspBuild/.wasp/out/sdk/wasp/dist/server/_types/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/server/_types/serialization.js +waspBuild/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map +waspBuild/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js +waspBuild/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map +waspBuild/.wasp/out/sdk/wasp/dist/server/config.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/server/config.js +waspBuild/.wasp/out/sdk/wasp/dist/server/config.js.map +waspBuild/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/server/dbClient.js +waspBuild/.wasp/out/sdk/wasp/dist/server/dbClient.js.map +waspBuild/.wasp/out/sdk/wasp/dist/server/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/server/index.js +waspBuild/.wasp/out/sdk/wasp/dist/server/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js +waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map +waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/index.js +waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js +waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js +waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map +waspBuild/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/server/operations/index.js +waspBuild/.wasp/out/sdk/wasp/dist/server/operations/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js +waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js +waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map +waspBuild/.wasp/out/sdk/wasp/dist/server/types/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/server/types/index.js +waspBuild/.wasp/out/sdk/wasp/dist/server/types/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/server/utils.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/server/utils.js +waspBuild/.wasp/out/sdk/wasp/dist/server/utils.js.map +waspBuild/.wasp/out/sdk/wasp/dist/universal/types.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/universal/types.js +waspBuild/.wasp/out/sdk/wasp/dist/universal/types.js.map +waspBuild/.wasp/out/sdk/wasp/dist/universal/url.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/universal/url.js +waspBuild/.wasp/out/sdk/wasp/dist/universal/url.js.map +waspBuild/.wasp/out/sdk/wasp/dist/universal/validators.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/universal/validators.js +waspBuild/.wasp/out/sdk/wasp/dist/universal/validators.js.map +waspBuild/.wasp/out/sdk/wasp/entities/index.ts +waspBuild/.wasp/out/sdk/wasp/ext-src/Main.css +waspBuild/.wasp/out/sdk/wasp/ext-src/MainPage.jsx +waspBuild/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts +waspBuild/.wasp/out/sdk/wasp/ext-src/waspLogo.png +waspBuild/.wasp/out/sdk/wasp/package.json +waspBuild/.wasp/out/sdk/wasp/server/HttpError.ts +waspBuild/.wasp/out/sdk/wasp/server/_types/index.ts +waspBuild/.wasp/out/sdk/wasp/server/_types/serialization.ts +waspBuild/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts +waspBuild/.wasp/out/sdk/wasp/server/config.ts +waspBuild/.wasp/out/sdk/wasp/server/dbClient.ts +waspBuild/.wasp/out/sdk/wasp/server/index.ts +waspBuild/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts +waspBuild/.wasp/out/sdk/wasp/server/middleware/index.ts +waspBuild/.wasp/out/sdk/wasp/server/operations/actions/index.ts +waspBuild/.wasp/out/sdk/wasp/server/operations/actions/types.ts +waspBuild/.wasp/out/sdk/wasp/server/operations/index.ts +waspBuild/.wasp/out/sdk/wasp/server/operations/queries/index.ts +waspBuild/.wasp/out/sdk/wasp/server/operations/queries/types.ts +waspBuild/.wasp/out/sdk/wasp/server/types/index.ts +waspBuild/.wasp/out/sdk/wasp/server/utils.ts +waspBuild/.wasp/out/sdk/wasp/tsconfig.json +waspBuild/.wasp/out/sdk/wasp/universal/types.ts +waspBuild/.wasp/out/sdk/wasp/universal/url.ts +waspBuild/.wasp/out/sdk/wasp/universal/validators.ts +waspBuild/.wasp/out/sdk/wasp/vite-env.d.ts +waspBuild/.waspignore waspBuild/.wasproot waspBuild/main.wasp -waspBuild/src/.waspignore -waspBuild/src/client/Main.css -waspBuild/src/client/MainPage.jsx -waspBuild/src/client/tsconfig.json -waspBuild/src/client/vite-env.d.ts -waspBuild/src/client/vite.config.ts -waspBuild/src/client/waspLogo.png -waspBuild/src/server/tsconfig.json -waspBuild/src/shared/tsconfig.json +waspBuild/package.json +waspBuild/public/.gitkeep +waspBuild/src/Main.css +waspBuild/src/MainPage.jsx +waspBuild/src/vite-env.d.ts +waspBuild/src/waspLogo.png +waspBuild/tsconfig.json +waspBuild/vite.config.ts 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 6b56c32fc1..a382486cbe 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 @@ -2,541 +2,618 @@ [ [ "file", - ".dockerignore" + "../out/sdk/wasp/api/events.ts" ], - "a2a5ebe3785244437c0d490b4bfa1652c84b9ab0d4f25566fd7e69d1421d7a1b" + "91ec1889f649b608ca81cab8f048538b9dcc70f49444430b1e5b572af2a4970a" ], [ [ "file", - "Dockerfile" + "../out/sdk/wasp/api/index.ts" ], - "61df2044110c16c48bfe89f0798c689c256598cb6cbc37f9ea69b69ee6ffe2a4" + "6d69f0df651dd19d0a9cd137ee4a0d536358269b6bd91c25efaa6c254f06948a" ], [ [ "file", - "db/schema.prisma" + "../out/sdk/wasp/client/index.ts" ], - "6f7b1b109e332bad9eb3cda4a2caf4963f4918c91b546c06fa42d8986c0b94a2" + "526d2f787c68b0be87064eb4c7771394f2987b6669b5fd39f9d240dcbfc2356c" ], [ [ "file", - "server/.gitignore" + "../out/sdk/wasp/client/operations/actions/core.d.ts" ], - "2c3d81dd719ff91d51609a02d03ba62ad456e2c50763b7b4c761395cb583f890" + "676855c039620769cc6ac728149d263c438024e5888ea0afd7f575507a95682a" ], [ [ "file", - "server/.npmrc" + "../out/sdk/wasp/client/operations/actions/core.js" ], - "8a74b1091affea3c71c2cf04acbaa38c4a51a261a9a98dcc9e96473d07a85a27" + "620a4aefbab701dd47b8bf21a07fc4e081ae1fd297261c5af7a05f21f558dff1" ], [ [ "file", - "server/README.md" + "../out/sdk/wasp/client/operations/actions/index.ts" ], - "e14514b8b152dd2160a217d8fc66a710c8607c4ed1441a2148a0770701818249" + "cada58ebdd19f239b97a4cc6bfc1d37b855022629457ddb0c03ff9317aa8e8f0" ], [ [ "file", - "server/nodemon.json" + "../out/sdk/wasp/client/operations/core.ts" ], - "c4c69994805c8e0d993bd39fec9e52478b5e656bae565fa1c19ef378901a7139" + "bad860771b16a0d4830fab22de8b85e63c840d47dc3728728a23b8ada91061ef" ], [ [ "file", - "server/package.json" + "../out/sdk/wasp/client/operations/index.ts" ], - "72e5881bb95ccc51f16d4bc27e45f9203aba6a96c814d4626f2abf8906a8cd61" + "4a66c90319dd7ef0d3a8e6c1f571037c7dfd9778b9def6e951813dbc4b4dcef3" ], [ [ "file", - "server/scripts/universal/validators.mjs" + "../out/sdk/wasp/client/operations/internal/index.ts" ], - "94edf3906c43fb476b22244d07a5d69fd6c967de767532ed5b3215e2a6eee91b" + "0cd5c744f0d883d48a6c1ddf8eacbe48059e123e79c5f39fad2d17073b6c9f9e" ], [ [ "file", - "server/scripts/validate-env.mjs" + "../out/sdk/wasp/client/operations/internal/resources.js" ], - "b507ff0f8cbdac18a0b42ccbb7acda9a5cd88e0ac5f95ca3d42341944298062d" + "0f3a0e4d19ceff419a6343ab5162d8b0985673f9d3d7d76bd4471fae0076fe17" ], [ [ "file", - "server/src/_types/index.ts" + "../out/sdk/wasp/client/operations/internal/updateHandlersMap.js" ], - "b6b5d08ff823cf66d47932167a4008307acb53cef2e409f26621e8b268ba8008" + "07a9933a771853585fd2fc49c3dcb9f1cad947acb2168580c835fae25620fa9f" ], [ [ "file", - "server/src/_types/serialization.ts" + "../out/sdk/wasp/client/operations/queries/core.d.ts" ], - "73dc983c9a02cab8e2f189f1ddedd9cdcd47bf403c9dc56efba8be895b6980a1" + "8ca19541652926772e2a7c5d88b5497b7760e98bc9d19c9a217bd03d83cec97d" ], [ [ "file", - "server/src/_types/taggedEntities.ts" + "../out/sdk/wasp/client/operations/queries/core.js" ], - "783703d6c7174bc262778598da7e24b1c9727e4fd1826f5d9a947ab701fe0977" + "34425abc901cd6294ca902df6b0c080aeafe2b3abf5b539c5e622020601f838e" ], [ [ "file", - "server/src/actions/types.ts" + "../out/sdk/wasp/client/operations/queries/index.ts" ], - "a994ed1f89011c04014deb57a2c26d09c216491caac9269380a7c14d1718b313" + "9d188907e5a3175e1bdada1c242ee4741eb866598d06d9d71d73a01e7a9a8ba2" ], [ [ "file", - "server/src/app.js" + "../out/sdk/wasp/client/operations/queryClient.ts" + ], + "5c1d87ac10513788bcde7ebc7c10601b9ad0854cddff355e8fb7e2d4685ecdef" + ], + [ + [ + "file", + "../out/sdk/wasp/client/router/Link.tsx" + ], + "80db39a38f50833f8c965bfd7758da990083db60a6f2f8e394353eed5f981cc9" + ], + [ + [ + "file", + "../out/sdk/wasp/client/router/index.ts" + ], + "6fe430c2956c25c3833d6893c695523a7b2a5f1cb9eceb0bed26429c2e33e6a0" + ], + [ + [ + "file", + "../out/sdk/wasp/client/router/linkHelpers.ts" ], - "86504ede1daeca35cc93f665ca8ac2fdf46ecaff02f6d3a7810a14d2bc71e16a" + "62e48c724070c59a95c837288112922326e1351ee1defa4759bdc47f7361ce9e" ], [ [ "file", - "server/src/config.js" + "../out/sdk/wasp/client/router/types.ts" ], - "d135535e045e5f5852e0b6d8bd49360e7231021cd38b540f419f5f44c6158dc2" + "d6feb23110d8cae5c94badd5cdec320207e1a5406cb827eb684aa4cffc3d7050" ], [ [ "file", - "server/src/core/AuthError.js" + "../out/sdk/wasp/client/test/index.ts" ], - "5ac18ed20c5c8b192a75d1cb2f36906d5ff9f0951451a2ef08d9ab62fc26b8bb" + "cb2e2dc33df8afc0d4453f4322a4e2af92f3345e9622e0416fa87e34d6acb9d8" ], [ [ "file", - "server/src/core/HttpError.js" + "../out/sdk/wasp/client/test/vitest/helpers.tsx" ], - "fa06ff60ab8183e8d00c13805692fc8cd3b5a21408edce4f0949d5b913e066b1" + "e0fbaf237a21b52ff47897fb1f1b1bffb0085670b71ba7d0b1d90547ab5a8f3b" ], [ [ "file", - "server/src/dbClient.ts" + "../out/sdk/wasp/core/config.ts" ], - "f26bfa4a60022d45195f3179548c4b09305f6a9cfe301b5edd1615677a59ae3f" + "12a7dffb1c3fe762cec8d9d928af353cb169ff199d3934b1f3c27ce0e3a2f987" ], [ [ "file", - "server/src/dbSeed/types.ts" + "../out/sdk/wasp/core/storage.ts" ], - "47442c546d286164c2cdb3359deb45b47f115df2ca72bb181b4639bee2059d38" + "e9e2a4a02d48bea1597fcdc00592e3d975eea7fa6e0545cf087da9429c5f4979" ], [ [ "file", - "server/src/entities/index.ts" + "../out/sdk/wasp/dev/index.ts" + ], + "1c15a2858ffe39f3ef83e53705cb25b00f09e895c04cf1a354210b5babdde895" + ], + [ + [ + "file", + "../out/sdk/wasp/entities/index.ts" ], "c59b97b122b977b5171686c92ee5ff2d80d397c2e83cc0915affb6ee136406fb" ], [ [ "file", - "server/src/middleware/globalMiddleware.ts" + "../out/sdk/wasp/ext-src/Main.css" ], - "5ecfd79481386c7ba17747a6d786166c8a7f95e331462d15303e1abf7cd031b7" + "1583ce49887ea575e563dab0c7ad6d2e2e3e6a351ed7c2f80c310641b1456417" ], [ [ "file", - "server/src/middleware/index.ts" + "../out/sdk/wasp/ext-src/MainPage.jsx" ], - "e658719309f9375f389c5d8d416fc27f9c247049e61188b3e01df954bcec15a4" + "4aead352bd5bbb5134b5e1f0927cf94966d80aa9dbbbb1f616e79fec8ae594e4" ], [ [ "file", - "server/src/middleware/operations.ts" + "../out/sdk/wasp/ext-src/vite-env.d.ts" ], - "864c7492c27f6da1e67645fbc358dc803a168852bfd24f2c4dd13fccf6917b07" + "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5" ], [ [ "file", - "server/src/polyfill.ts" + "../out/sdk/wasp/ext-src/waspLogo.png" ], - "66d3dca514bdd01be402714d0dfe3836e76f612346dea57ee595ae4f3da915cf" + "0f05a89eb945d6d7326110e88776e402833b356202b06d0a8bf652e118d3fd2f" ], [ [ "file", - "server/src/queries/types.ts" + "../out/sdk/wasp/package.json" ], - "276f022c04936bfe75d593fe8426a0aaf43a0e9c085042ad1b6560ad23041031" + "8c4e7254985043dbada72ea8caa14dc82e154e5d1d3384677b7986f9ba8ef833" ], [ [ "file", - "server/src/routes/index.js" + "../out/sdk/wasp/server/HttpError.ts" ], - "c34f77a96150414957386f5645c9becb12725c9f231aaaa8db798e3564bd75ce" + "eaa296c30acc65c78b90ebdf9a1d6fdb863f0c26c743d352afaeaa3bbc2fdd1b" ], [ [ "file", - "server/src/routes/operations/index.js" + "../out/sdk/wasp/server/_types/index.ts" ], - "d09f7dcf78ed2da15f488afb08e62d9dac15f173fdbe779323dfdd75330f5de5" + "2eb94c60f2031ae3ea023de5aa938b3aeabba31388a7f8bdcdee432bbef3f517" ], [ [ "file", - "server/src/server.ts" + "../out/sdk/wasp/server/_types/serialization.ts" ], - "d0666b659cdc75db181ea2bbb50c4e157f0a7fbe00c4ff8fda0933b1a13e5a0e" + "cfa5bcdd91e36fe35a91323bd3944a52873144101a5a03ae8a4f258cdd61ea03" ], [ [ "file", - "server/src/types/index.ts" + "../out/sdk/wasp/server/_types/taggedEntities.ts" ], - "f7621082fc7d8467a0967eb0bd82ff7956052b766e9e82d50584b8de88e0d28a" + "94a8c58d122296edd8803618b878c66dc1ce27035735f31bb97d6a58be219324" ], [ [ "file", - "server/src/universal/types.ts" + "../out/sdk/wasp/server/config.ts" ], - "8ef378c1447289104856ec1a92931fd1280c0f8d0a8463008674e93bd798b884" + "4976e545d8fcf019508e95f472305e9ef27dfb3423c71e428a5414e35cdd52be" ], [ [ "file", - "server/src/universal/url.ts" + "../out/sdk/wasp/server/dbClient.ts" ], - "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" + "50f11eb232174184be5fd44e8ee3875c30707b486c8c70c3f7bfb93609d38e66" ], [ [ "file", - "server/src/utils.ts" + "../out/sdk/wasp/server/index.ts" ], - "6a664e44a89efe8ed8cb7559a84bd2871422c38287b276fee2a7aed4680e1d1e" + "51c3e0802764f72b88f6daaf148dba514ae817e233a40cc9b92ec91784f71f98" ], [ [ "file", - "server/tsconfig.json" + "../out/sdk/wasp/server/middleware/globalMiddleware.ts" ], - "51a60d6350537a9e0696674aae86b122a7dea2a4497d294fd4fd6bc47b7e9808" + "53f258be83ca6de653b6b645253ce573e3c177e88017eb2adb17f5d3cebb36c3" ], [ [ "file", - "web-app/.gitignore" + "../out/sdk/wasp/server/middleware/index.ts" ], - "d373417ea2a8844e3b7a1515aab123e90fbeb4b7225144d55d243d9f6f04f73a" + "e658719309f9375f389c5d8d416fc27f9c247049e61188b3e01df954bcec15a4" ], [ [ "file", - "web-app/.npmrc" + "../out/sdk/wasp/server/operations/actions/index.ts" ], - "7151cf397def0c2cb0ab65643701d27d335a72c90f775675b5f826bc7005818a" + "c67a0c7d8946f5c465edea2de78e78537384bd6f30ec4f4fd6dfe58243f4f36a" ], [ [ "file", - "web-app/README.md" + "../out/sdk/wasp/server/operations/actions/types.ts" ], - "6af47b8c26fa9d30e9b774e6c38d3456a3b469c3101bffb186e2a1fb325a93f4" + "cc03111599e32695d677e8ac4e65b98cf90e0cb066e71c3da06af254c784b489" ], [ [ "file", - "web-app/index.html" + "../out/sdk/wasp/server/operations/index.ts" ], - "503f37673a444e70b8954eec7efb5365d5e80971de0a5bee9cba56f73bbbd83c" + "b185af725a91995c8eb76d1c3560a488e9caef664d0add8620e2ea387e2be7f8" ], [ [ "file", - "web-app/netlify.toml" + "../out/sdk/wasp/server/operations/queries/index.ts" ], - "854009c7d1b2630a55099439f89e4947188ea4160c9d1388b46b5a5cf6ab461a" + "c67a0c7d8946f5c465edea2de78e78537384bd6f30ec4f4fd6dfe58243f4f36a" ], [ [ "file", - "web-app/package.json" + "../out/sdk/wasp/server/operations/queries/types.ts" ], - "80acc7a0e40fbf57cfa9a60749530e2c59c473161a7f379e4f956865cfe9379a" + "19f72a3a37efd1e29b0793caa7f379494ad236bb513c8c8804b5a8d305c45196" ], [ [ "file", - "web-app/public/favicon.ico" + "../out/sdk/wasp/server/types/index.ts" ], - "1481f03584b46b63182c1f8d26e61a95ce4d8fae032b2b4f3fe5e00ab7e96c23" + "0f2ffdfdd76c92084bd0ba270b674628ec907da0d047de6c8a9912e415462d97" ], [ [ "file", - "web-app/public/manifest.json" + "../out/sdk/wasp/server/utils.ts" ], - "696886c4dd2bb66df380e2a9ebf07d54fe39b25af968aeea090ed6fb528d402e" + "a4178a3e2527d47d141340b99abf675125859fa9cb5a0535e3efa7b34a3bcabb" ], [ [ "file", - "web-app/scripts/universal/validators.mjs" + "../out/sdk/wasp/tsconfig.json" ], - "94edf3906c43fb476b22244d07a5d69fd6c967de767532ed5b3215e2a6eee91b" + "5a1d45e247132b9afbfabb9073749a924a86bfefe945a954c1f44ec672e1fef3" ], [ [ "file", - "web-app/scripts/validate-env.mjs" + "../out/sdk/wasp/universal/types.ts" ], - "690460410bc9b28a8e96c6e20902e841f07b77faccf3db7e7249f48f700f4bab" + "8ef378c1447289104856ec1a92931fd1280c0f8d0a8463008674e93bd798b884" ], [ [ "file", - "web-app/src/actions/core.d.ts" + "../out/sdk/wasp/universal/url.ts" ], - "34b44699906b98ca28050479b66254e64073a403b571a8fd1a227395d27becae" + "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" ], [ [ "file", - "web-app/src/actions/core.js" + "../out/sdk/wasp/universal/validators.ts" ], - "f38003d51d9754952bf595a25fdb44580d88af3bcd6658848cf8a339a8240689" + "80c624ff5caa11fcaa66c74eb3a473dbedc9bbac3ece740361d7752f5f45d38f" ], [ [ "file", - "web-app/src/actions/index.ts" + "../out/sdk/wasp/vite-env.d.ts" ], - "607c3311861456ae47c246a950c8e29593f9837a9f5c48923d99cd7fac1ce0bb" + "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5" ], [ [ "file", - "web-app/src/api.ts" + ".dockerignore" ], - "850331885230117aa56317186c6d38f696fb1fbd0c56470ff7c6e4f3c1c43104" + "a2a5ebe3785244437c0d490b4bfa1652c84b9ab0d4f25566fd7e69d1421d7a1b" ], [ [ "file", - "web-app/src/api/events.ts" + "Dockerfile" ], - "91ec1889f649b608ca81cab8f048538b9dcc70f49444430b1e5b572af2a4970a" + "ab6bdf75fb4a56816d65231773dcce1f7133b18da6803f2b035f35bf124ea1c0" ], [ [ "file", - "web-app/src/config.js" + "db/schema.prisma" ], - "b06175129dd8be8ca6c307fafa02646d47233c4e26fdfeea6d7802d02e9513f3" + "da3893a91e81d48dc133c12616d1769a556b29610736b327fd4ef179040c07ab" ], [ [ "file", - "web-app/src/entities/index.ts" + "server/.gitignore" ], - "52d61b8ed11976d75b351d2b7227469697781fbf8996b5b98143e220ada383f9" + "2c3d81dd719ff91d51609a02d03ba62ad456e2c50763b7b4c761395cb583f890" ], [ [ "file", - "web-app/src/ext-src/Main.css" + "server/.npmrc" ], - "1583ce49887ea575e563dab0c7ad6d2e2e3e6a351ed7c2f80c310641b1456417" + "8a74b1091affea3c71c2cf04acbaa38c4a51a261a9a98dcc9e96473d07a85a27" + ], + [ + [ + "file", + "server/README.md" + ], + "e14514b8b152dd2160a217d8fc66a710c8607c4ed1441a2148a0770701818249" ], [ [ "file", - "web-app/src/ext-src/MainPage.jsx" + "server/nodemon.json" ], - "8ee7fe1352719facadf0935eb45df8661ba13015277ea80be5a9200c66a31bde" + "6cb3f8539e5cf59e29e3c97c9b4fa405600ea132784e4f47f79555951f47bd38" ], [ [ "file", - "web-app/src/ext-src/vite-env.d.ts" + "server/package.json" ], - "d677883c270ee71acc9bfd95c824650b541036599427a8ffc0ad33323d08e61d" + "40898402c8a6ca25f91c17f884e7401bd7e53710da91a8399f2e2c722c273c3b" ], [ [ "file", - "web-app/src/ext-src/vite.config.ts" + "server/rollup.config.js" ], - "797dfb8022557b5ce5ce856daca01911974497f9ccf656f5920e5b42a986f4f8" + "c1beb8264f11898364288d73b16f08d1923bac5f70038d9827978deb5b58a2da" ], [ [ "file", - "web-app/src/ext-src/waspLogo.png" + "server/scripts/validate-env.mjs" ], - "0f05a89eb945d6d7326110e88776e402833b356202b06d0a8bf652e118d3fd2f" + "65168a764fc6cbe785ee40a8e8533b4694ef9019fc5a73f60f7252152330d0a2" ], [ [ "file", - "web-app/src/index.tsx" + "server/src/actions/types.ts" ], - "d10c443130afd9848fcfa631424590784e70dc1c66a8b7a9a8c1dfa9dd7ad5df" + "cc03111599e32695d677e8ac4e65b98cf90e0cb066e71c3da06af254c784b489" ], [ [ "file", - "web-app/src/logo.png" + "server/src/app.js" ], - "35f14abf46cb0e9d9b4e3d11961917eecb86be65a0d7f4e6bc9713c5766b5f1b" + "a10bb6f3daab886b0685994368711fd7718a2a3e50a9329cd7da6394b9c59302" ], [ [ "file", - "web-app/src/operations/index.ts" + "server/src/middleware/globalMiddleware.ts" ], - "7ec3870a9313ec17d2282f9002da4a5d4da3c096c5fb0927acd008f1bec60bb3" + "312850493f4b17b42d5878b1c41be7db66e11bf5cf1997f9506cb06ee05ab5bd" ], [ [ "file", - "web-app/src/operations/resources.js" + "server/src/middleware/index.ts" ], - "c08445d84f9931ebc3e4f975017bf88c03b6bee9aa588e945d52fe3aee9c4d70" + "e658719309f9375f389c5d8d416fc27f9c247049e61188b3e01df954bcec15a4" ], [ [ "file", - "web-app/src/operations/updateHandlersMap.js" + "server/src/middleware/operations.ts" ], - "07a9933a771853585fd2fc49c3dcb9f1cad947acb2168580c835fae25620fa9f" + "23efbb9c408f8c12bdb77359a48177430b7da636163562d0105560891ac225b9" ], [ [ "file", - "web-app/src/queries/core.d.ts" + "server/src/polyfill.ts" ], - "8ac475ed46a373ddc47e37dd557315c9c15abcde527749bb40c08527130e0567" + "66d3dca514bdd01be402714d0dfe3836e76f612346dea57ee595ae4f3da915cf" ], [ [ "file", - "web-app/src/queries/core.js" + "server/src/queries/types.ts" ], - "3ac4a8402a7d6af3eb4a90ec59bcfdd32585f3f2dc6d6bed8a1140cea8fdb7f2" + "19f72a3a37efd1e29b0793caa7f379494ad236bb513c8c8804b5a8d305c45196" ], [ [ "file", - "web-app/src/queries/index.d.ts" + "server/src/routes/index.js" ], - "f3a7cf037867cd7f8ce76cbca5e5eb2aacb9ca69933c182bce2f7ff935c4d385" + "c34f77a96150414957386f5645c9becb12725c9f231aaaa8db798e3564bd75ce" ], [ [ "file", - "web-app/src/queries/index.js" + "server/src/routes/operations/index.js" ], - "8379699fa710f43d5be2b96f3a5c7c551a8d3d9db3ef0fea964502da00f36ffc" + "d09f7dcf78ed2da15f488afb08e62d9dac15f173fdbe779323dfdd75330f5de5" ], [ [ "file", - "web-app/src/queryClient.js" + "server/src/server.ts" ], - "1739d8618286b4a2aa536bd3fcb754514c828ec896b69c7074e22f66c07e7b03" + "ab9d7722a512f2a51a81a63de0b81172421dc86a6556c49f70aab4683d57657f" ], [ [ "file", - "web-app/src/router.tsx" + "server/tsconfig.json" ], - "067478c4990bbe966fa1984cd9db91aba9aaa68196c5858eab787eb376ab48b9" + "ae9b0031fd08188a5fa7ab0a0994dfe9bdbd1d8f2e1ba2df4f609b9b470eb6b4" ], [ [ "file", - "web-app/src/router/Link.tsx" + "web-app/.gitignore" ], - "7b6214295d59d8dffbd61b82f9dab2b080b2d7ebe98cc7d9f9e8c229f99a890d" + "d373417ea2a8844e3b7a1515aab123e90fbeb4b7225144d55d243d9f6f04f73a" ], [ [ "file", - "web-app/src/router/linkHelpers.ts" + "web-app/.npmrc" ], - "c296ed5e7924ad1173f4f0fb4dcce053cffd5812612069b5f62d1bf9e96495cf" + "7151cf397def0c2cb0ab65643701d27d335a72c90f775675b5f826bc7005818a" ], [ [ "file", - "web-app/src/router/types.ts" + "web-app/README.md" ], - "7f08b262987c17f953c4b95814631a7aaac82eb77660bcb247ef7bf866846fe1" + "6af47b8c26fa9d30e9b774e6c38d3456a3b469c3101bffb186e2a1fb325a93f4" ], [ [ "file", - "web-app/src/storage.ts" + "web-app/index.html" ], - "e9e2a4a02d48bea1597fcdc00592e3d975eea7fa6e0545cf087da9429c5f4979" + "503f37673a444e70b8954eec7efb5365d5e80971de0a5bee9cba56f73bbbd83c" ], [ [ "file", - "web-app/src/test/index.ts" + "web-app/netlify.toml" ], - "cb2e2dc33df8afc0d4453f4322a4e2af92f3345e9622e0416fa87e34d6acb9d8" + "854009c7d1b2630a55099439f89e4947188ea4160c9d1388b46b5a5cf6ab461a" ], [ [ "file", - "web-app/src/test/vitest/helpers.tsx" + "web-app/package.json" ], - "a38e55c9999a87ab497538bcad7c880f32a4d27f2227ae326cb76eb0848b89e9" + "c9ec6110684c2e6c76392fc93458756ca636fa30f2b6c23db1507c0cc910e8b8" ], [ [ "file", - "web-app/src/test/vitest/setup.ts" + "web-app/public/.gitkeep" ], - "1c08b10e428cec3939e0ab269c9a02694e196de7c5dd9f18372424bdccbc5028" + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ], [ [ "file", - "web-app/src/types.ts" + "web-app/public/favicon.ico" ], - "282f6bdef1e7e8846ad53909bbf88c54cd04a0594b77b1e87cb69266de84cc6d" + "1481f03584b46b63182c1f8d26e61a95ce4d8fae032b2b4f3fe5e00ab7e96c23" ], [ [ "file", - "web-app/src/universal/types.ts" + "web-app/public/manifest.json" ], - "8ef378c1447289104856ec1a92931fd1280c0f8d0a8463008674e93bd798b884" + "696886c4dd2bb66df380e2a9ebf07d54fe39b25af968aeea090ed6fb528d402e" ], [ [ "file", - "web-app/src/universal/url.ts" + "web-app/scripts/validate-env.mjs" ], - "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" + "a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd" + ], + [ + [ + "file", + "web-app/src/entities/index.ts" + ], + "52d61b8ed11976d75b351d2b7227469697781fbf8996b5b98143e220ada383f9" + ], + [ + [ + "file", + "web-app/src/index.tsx" + ], + "ff83778b7f03a8f15116bc73adce607c2c13fc9cbd4228626980a530541aaeb2" + ], + [ + [ + "file", + "web-app/src/logo.png" + ], + "35f14abf46cb0e9d9b4e3d11961917eecb86be65a0d7f4e6bc9713c5766b5f1b" + ], + [ + [ + "file", + "web-app/src/queryClient.js" + ], + "1739d8618286b4a2aa536bd3fcb754514c828ec896b69c7074e22f66c07e7b03" + ], + [ + [ + "file", + "web-app/src/router.tsx" + ], + "aaa46223db86cf8a7af9c2fe89d50345e0d9b3fa2587e91f4680810d032db452" + ], + [ + [ + "file", + "web-app/src/test/vitest/setup.ts" + ], + "610e936776aaa39e861f0b2a83b0c0290d74ca8123d9d5409e5f2183384fdb52" ], [ [ @@ -557,7 +634,7 @@ "file", "web-app/tsconfig.json" ], - "f1b31ca75b2b32c5b0441aec4fcd7f285c18346761ba1640761d6253d65e3580" + "dfeee6d883ed2504c149c64b24ca939c0ad4812b78bfdced7293a386a008effd" ], [ [ @@ -571,6 +648,6 @@ "file", "web-app/vite.config.ts" ], - "08962d79f2d71eb470ee85dee03db6deca7ede28df9d41542bbaea752db0eeed" + "64256d93d81f6192f419e836ed4484f0e8c1e28f018bfb3213851608200594ac" ] ] \ No newline at end of file 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 57a8aea124..ffc14b90bf 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 @@ -2,7 +2,7 @@ # Because if not, we had situations where it would use the different version # locally and on Github CI. This way we ensure exact version is used, # and also have control over updating it (instead of update surprising us). -FROM node:18-alpine3.17 AS node +FROM node:18.18.0-alpine3.17 AS node # We split Dockerfile into base, server-builder and server-production. @@ -17,14 +17,27 @@ FROM node AS base RUN apk --no-cache -U upgrade # To ensure any potential security patches are applied. +# Todo: The 'server-builder' image stays on disk under : and is +# relatively large (~900 MB), should we remove it? Or is it useful for future +# builds? FROM base AS server-builder -RUN apk add --no-cache build-base libtool autoconf automake +# Building the Docker image on Apple's Silicon Mac fails without python3 (the build +# throws `node-gyp` errors when it tries to compile native deps. Installing +# `python3` fixes the issue. +RUN apk add --no-cache python3 build-base libtool autoconf automake WORKDIR /app -COPY server/ ./server/ +# Since the framwork code in /.wasp/build/server imports the user code in /src +# using relative imports, we must mirror the same directory structure in the +# Docker image. +COPY src ./src +COPY package.json . +COPY package-lock.json . +COPY .wasp/build/server .wasp/build/server +COPY .wasp/out/sdk .wasp/out/sdk # Install npm packages, resulting in node_modules/. -RUN cd server && npm install +RUN npm install && cd .wasp/build/server && npm install # Building the server should come after Prisma generation. -RUN cd server && npm run build +RUN cd .wasp/build/server && npm run bundle # TODO: Use pm2? @@ -34,13 +47,21 @@ FROM base AS server-production RUN apk add --no-cache python3 ENV NODE_ENV production WORKDIR /app -COPY --from=server-builder /app/server/node_modules ./server/node_modules -COPY --from=server-builder /app/server/dist ./server/dist -COPY --from=server-builder /app/server/package*.json ./server/ -COPY --from=server-builder /app/server/scripts ./server/scripts -COPY db/ ./db/ +# Copying the top level 'node_modules' because it contains the Prisma packages +# necessary for migrating the database. +COPY --from=server-builder /app/node_modules ./node_modules +# Copying the SDK because 'validate-env.mjs' executes independent of the bundle +# and references the 'wasp' package. +COPY --from=server-builder /app/.wasp/out/sdk .wasp/out/sdk +# Copying 'server/node_modules' because 'validate-env.mjs' executes independent +# of the bundle and references the dotenv package. +COPY --from=server-builder /app/.wasp/build/server/node_modules .wasp/build/server/node_modules +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/ EXPOSE ${PORT} -WORKDIR /app/server +WORKDIR /app/.wasp/build/server ENTRYPOINT ["npm", "run", "start-production"] diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/db/schema.prisma b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/db/schema.prisma index 7430793da5..2725a6a54e 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/db/schema.prisma +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/db/schema.prisma @@ -6,6 +6,5 @@ datasource db { generator client { provider = "prisma-client-js" - output = env("PRISMA_CLIENT_OUTPUT_DIR") } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedFullStackNpmDependencies.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedFullStackNpmDependencies.json deleted file mode 100644 index 7f7d12ca30..0000000000 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedFullStackNpmDependencies.json +++ /dev/null @@ -1 +0,0 @@ -{"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"express","version":"~4.18.1"},{"name":"morgan","version":"~1.10.0"},{"name":"@prisma/client","version":"4.16.2"},{"name":"jsonwebtoken","version":"^8.5.1"},{"name":"secure-password","version":"^4.0.0"},{"name":"dotenv","version":"16.0.2"},{"name":"helmet","version":"^6.0.0"},{"name":"patch-package","version":"^6.4.7"},{"name":"uuid","version":"^9.0.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"nodemon","version":"^2.0.19"},{"name":"standard","version":"^17.0.0"},{"name":"prisma","version":"4.16.2"},{"name":"typescript","version":"^5.1.0"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/uuid","version":"^9.0.0"},{"name":"@types/cors","version":"^2.8.5"}]},"npmDepsForWebApp":{"dependencies":[{"name":"axios","version":"^1.4.0"},{"name":"react","version":"^18.2.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"@prisma/client","version":"4.16.2"},{"name":"superjson","version":"^1.12.2"},{"name":"mitt","version":"3.0.0"},{"name":"react-hook-form","version":"^7.45.4"}],"devDependencies":[{"name":"vite","version":"^4.3.9"},{"name":"typescript","version":"^5.1.0"},{"name":"@types/react","version":"^18.0.37"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react-swc","version":"^3.0.0"},{"name":"dotenv","version":"^16.0.3"},{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"vitest","version":"^0.29.3"},{"name":"@vitest/ui","version":"^0.29.3"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.0.0"},{"name":"@testing-library/jest-dom","version":"^5.16.5"},{"name":"msw","version":"^1.1.0"}]}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedNpmDepsLog.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedNpmDepsLog.json new file mode 100644 index 0000000000..a010ca4b88 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedNpmDepsLog.json @@ -0,0 +1 @@ +{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"4.16.2"},{"name":"prisma","version":"4.16.2"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"jsonwebtoken","version":"^8.5.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"secure-password","version":"^4.0.0"},{"name":"sodium-native","version":"3.3.0"},{"name":"superjson","version":"^1.12.2"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"4.16.2"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"jsonwebtoken","version":"^8.5.1"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"secure-password","version":"^4.0.0"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/nodemon.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/nodemon.json index 9ac8c1df77..01fe71701a 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/nodemon.json +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/nodemon.json @@ -4,7 +4,9 @@ }, "watch": [ "src/", + "../../../src/", ".env" ], + "comment-filip": "We now have to watch ../../../src/ because we're importing client files directly", "ext": "ts,mts,js,mjs,json" } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/package.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/package.json index f2bd3cba5c..dd943c4429 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/package.json +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/package.json @@ -1,19 +1,16 @@ { + "comment-filip": "The server.js location changed because we have now included client source files above .wasp/out/server/src.", "dependencies": { - "@prisma/client": "4.16.2", "cookie-parser": "~1.4.6", "cors": "^2.8.5", "dotenv": "16.0.2", "express": "~4.18.1", "helmet": "^6.0.0", "jsonwebtoken": "^8.5.1", - "lodash.merge": "^4.6.2", "morgan": "~1.10.0", - "patch-package": "^6.4.7", "rate-limiter-flexible": "^2.4.1", "secure-password": "^4.0.0", - "superjson": "^1.12.2", - "uuid": "^9.0.0" + "superjson": "^1.12.2" }, "devDependencies": { "@tsconfig/node18": "latest", @@ -21,38 +18,32 @@ "@types/express": "^4.17.13", "@types/express-serve-static-core": "^4.17.13", "@types/node": "^18.0.0", - "@types/uuid": "^9.0.0", "nodemon": "^2.0.19", - "prisma": "4.16.2", - "standard": "^17.0.0", - "typescript": "^5.1.0" + "rollup": "^4.9.6", + "rollup-plugin-esbuild": "^6.1.1", + "standard": "^17.0.0" }, "engineStrict": true, "engines": { - "node": ">=18.0.0" + "node": ">=18.18.0" }, "name": "server", "nodemonConfig": { "delay": "1000" }, - "overrides": { - "secure-password": { - "sodium-native": "3.3.0" - } - }, + "overrides": {}, "prisma": {}, "private": true, "scripts": { - "build": "npx tsc", - "build-and-start": "npm run build && npm run start", + "bundle": "rollup --config --silent", + "bundle-and-start": "npm run bundle && npm run start", "db-migrate-prod": "prisma migrate deploy --schema=../db/schema.prisma", - "db-seed": "npm run build && NODE_PATH=dist node -r dotenv/config dist/dbSeed.js", - "postinstall": "patch-package", + "db-seed": "npm run bundle && node --enable-source-maps -r dotenv/config bundle/dbSeed.js", "standard": "standard", - "start": "npm run validate-env && NODE_PATH=dist node -r dotenv/config dist/server.js", + "start": "npm run validate-env && node --enable-source-maps -r dotenv/config bundle/server.js", "start-production": "NODE_ENV=production npm run start", "validate-env": "node -r dotenv/config ./scripts/validate-env.mjs", - "watch": "nodemon --exec 'npm run build-and-start || exit 1'" + "watch": "nodemon --exec 'npm run bundle-and-start || exit 1'" }, "type": "module", "version": "0.0.0" diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/rollup.config.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/rollup.config.js new file mode 100644 index 0000000000..9f0b986fb9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/rollup.config.js @@ -0,0 +1,24 @@ +import esbuild from 'rollup-plugin-esbuild' + +export default [ + createBundle('src/server.ts', 'bundle/server.js'), +] + +function createBundle(inputFilePath, outputFilePath) { + return { + input: inputFilePath, + output: { + file: outputFilePath, + format: 'es', + sourcemap: true, + }, + plugins: [ + esbuild({ + target: 'esnext', + }), + ], + // We don't want to bundle any of the node_module deps + // as we want to keep them as external dependencies + external: (id) => !/^[./]/.test(id), + } +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/scripts/validate-env.mjs index fb68580bbb..ac264b7961 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/scripts/validate-env.mjs +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/scripts/validate-env.mjs @@ -1,4 +1,4 @@ -import { throwIfNotValidAbsoluteURL } from './universal/validators.mjs'; +import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; console.info("🔍 Validating environment variables..."); throwIfNotValidAbsoluteURL(process.env.WASP_WEB_CLIENT_URL, 'Environment variable WASP_WEB_CLIENT_URL'); diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/actions/types.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/actions/types.ts index b5fa48def7..183065b864 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/actions/types.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/actions/types.ts @@ -1,4 +1,4 @@ import { type Payload, -} from '../_types' +} from 'wasp/server/_types' diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/app.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/app.js index a15cb96cea..025a3c4c14 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/app.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/app.js @@ -1,6 +1,6 @@ import express from 'express' -import HttpError from './core/HttpError.js' +import { HttpError } from 'wasp/server' import indexRouter from './routes/index.js' // TODO: Consider extracting most of this logic into createApp(routes, path) function so that diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/core/AuthError.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/core/AuthError.js deleted file mode 100644 index 2d965c168e..0000000000 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/core/AuthError.js +++ /dev/null @@ -1,17 +0,0 @@ -class AuthError extends Error { - constructor (message, data, ...params) { - super(message, ...params) - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, AuthError) - } - - this.name = this.constructor.name - - if (data) { - this.data = data - } - } -} - -export default AuthError diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/dbClient.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/dbClient.ts deleted file mode 100644 index 66e7801be3..0000000000 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/dbClient.ts +++ /dev/null @@ -1,12 +0,0 @@ -import Prisma from '@prisma/client' - - -const createDbClient = () => { - const prismaClient = new Prisma.PrismaClient() - - return prismaClient -} - -const dbClient = createDbClient() - -export default dbClient diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/dbSeed/types.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/dbSeed/types.ts deleted file mode 100644 index fe0d5396a4..0000000000 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/dbSeed/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { PrismaClient } from '@prisma/client' - -export type DbSeedFn = (prismaClient: PrismaClient) => Promise diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/middleware/globalMiddleware.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/middleware/globalMiddleware.ts index 2eca3e9f74..ce46c57ead 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/middleware/globalMiddleware.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/middleware/globalMiddleware.ts @@ -4,14 +4,12 @@ import logger from 'morgan' import cors from 'cors' import helmet from 'helmet' -import config from '../config.js' +import { config } from 'wasp/server' +import type { MiddlewareConfig, MiddlewareConfigFn } from 'wasp/server/middleware' +export type { MiddlewareConfig, MiddlewareConfigFn } from 'wasp/server/middleware' const _waspGlobalMiddlewareConfigFn = (mc: MiddlewareConfig) => mc -export type MiddlewareConfig = Map - -export type MiddlewareConfigFn = (middlewareConfig: MiddlewareConfig) => MiddlewareConfig - // This is the set of middleware Wasp supplies by default. // NOTE: Remember to update the docs of these change. const defaultGlobalMiddlewareConfig: MiddlewareConfig = new Map([ diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/middleware/operations.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/middleware/operations.ts index cea765236b..a86f8a8157 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/middleware/operations.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/middleware/operations.ts @@ -2,7 +2,7 @@ import { deserialize as superjsonDeserialize, serialize as superjsonSerialize, } from 'superjson' -import { handleRejection } from '../utils.js' +import { handleRejection } from 'wasp/server/utils' export function createOperation (handlerFn) { return handleRejection(async (req, res) => { diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/queries/types.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/queries/types.ts index 8024d29f08..a156fb294a 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/queries/types.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/queries/types.ts @@ -1,5 +1,5 @@ import { type Payload, -} from '../_types' +} from 'wasp/server/_types' diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/server.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/server.ts index fff57f199b..b8b7e0c0b3 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/server.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/server.ts @@ -1,7 +1,7 @@ import http from 'http' import app from './app.js' -import config from './config.js' +import { config } from 'wasp/server' diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/tsconfig.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/tsconfig.json index f0ce78775e..68d7a47b0d 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/tsconfig.json +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/tsconfig.json @@ -2,7 +2,33 @@ "extends": "@tsconfig/node18/tsconfig.json", "compilerOptions": { // Overriding this until we implement more complete TypeScript support. + // Filip: begin client file hacks + // We need this to make server work with copied client files (we copy everything) + "jsx": "preserve", + "lib": [ + "esnext", + "dom", + "DOM.Iterable" + ], + // Filip: end client file hacks "strict": false, + // When left unspecified, the 'rootDir' defaults to the longest common path of + // all non-declaration input files. TypeScript mimics the source structure + // inside the output directory (i.e., 'dist'). + // + // Since Wasp apps can (but don't have to) import user files from + // '../../../src', it makes the rootDir's default value inconsistent: + // - When the app doesn't import user files (e.g., the user didn't specify + // any operations), the rootDir is set to the server source dir (/src). + // - When the app imports user files (as is the case for most Wasp apps), + // the rootDir is set to the Wasp project root (../../../). + // + // Our build script (in package.json) requires a consistent structure of + // the output directory, which is why we always make sure to point the rootDir + // to the Wasp project root (../../../). + // + // See this comment for more details: https://github.com/wasp-lang/wasp/pull/1584#discussion_r1404019301 + "rootDir": "../../../", // Overriding this because we want to use top-level await "module": "esnext", "target": "es2017", @@ -10,12 +36,13 @@ "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 }, - "include": ["src"] -} + "include": [ + "src" + ] +} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/package.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/package.json index 24049713e5..5950070455 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/package.json +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/package.json @@ -12,35 +12,24 @@ ] }, "dependencies": { - "@prisma/client": "4.16.2", "@tanstack/react-query": "^4.29.0", "axios": "^1.4.0", "mitt": "3.0.0", - "react": "^18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.45.4", "react-router-dom": "^5.3.3", "superjson": "^1.12.2" }, "devDependencies": { - "@testing-library/jest-dom": "^5.16.5", - "@testing-library/react": "^14.0.0", "@tsconfig/vite-react": "^2.0.0", - "@types/react": "^18.0.37", "@types/react-dom": "^18.0.11", "@types/react-router-dom": "^5.3.3", - "@vitejs/plugin-react-swc": "^3.0.0", - "@vitest/ui": "^0.29.3", - "dotenv": "^16.0.3", - "jsdom": "^21.1.1", - "msw": "^1.1.0", - "typescript": "^5.1.0", - "vite": "^4.3.9", - "vitest": "^0.29.3" + "@vitejs/plugin-react": "^4.2.1", + "dotenv": "^16.0.3" }, "engineStrict": true, "engines": { - "node": ">=18.0.0" + "node": ">=18.18.0" }, "name": "waspBuild", "private": true, diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/public/.gitkeep b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/public/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/scripts/validate-env.mjs index 27d6a9fd59..18ee507c9e 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/scripts/validate-env.mjs +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/scripts/validate-env.mjs @@ -1,4 +1,4 @@ -import { throwIfNotValidAbsoluteURL } from './universal/validators.mjs'; +import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; console.info("🔍 Validating environment variables..."); throwIfNotValidAbsoluteURL(process.env.REACT_APP_API_URL, 'Environemnt variable REACT_APP_API_URL'); diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/ext-src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/ext-src/vite-env.d.ts deleted file mode 100644 index 1623b9c79c..0000000000 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/ext-src/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/index.tsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/index.tsx index 17d6749e4a..0b7f1d9854 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/index.tsx +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/index.tsx @@ -6,7 +6,7 @@ import router from './router' import { initializeQueryClient, queryClientInitialized, -} from './queryClient' +} from 'wasp/client/operations' diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/queries/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/queries/index.d.ts deleted file mode 100644 index c007ff4c92..0000000000 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/queries/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { UseQueryResult } from "@tanstack/react-query"; - -export type Query = { - (queryCacheKey: string[], args: Input): Promise -} - -export function useQuery( - queryFn: Query, - queryFnArgs?: Input, options?: any -): UseQueryResult diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/queries/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/queries/index.js deleted file mode 100644 index 03e52ce0f9..0000000000 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/queries/index.js +++ /dev/null @@ -1,18 +0,0 @@ -import { useQuery as rqUseQuery } from '@tanstack/react-query' -export { configureQueryClient } from '../queryClient' - -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 - }) -} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/router.tsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/router.tsx index a18069e2e3..b5ca2c4620 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/router.tsx +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/router.tsx @@ -1,27 +1,15 @@ import React from 'react' import { Route, Switch, BrowserRouter as Router } from 'react-router-dom' -import { interpolatePath } from './router/linkHelpers' -import type { - RouteDefinitionsToRoutes, - OptionalRouteOptions, - ParamValue, -} from './router/types' -import MainPage from './ext-src/MainPage.jsx' +import { MainPage } from '../../../../src/MainPage.jsx' -export const routes = { - RootRoute: { - to: "/", - component: MainPage, - build: ( - options?: OptionalRouteOptions, - ) => interpolatePath("/", undefined, options.search, options.hash), - }, -} as const; +import { routes } from 'wasp/client/router' -export type Routes = RouteDefinitionsToRoutes +export const routeNameToRouteComponent = { + RootRoute: MainPage, +} as const; const router = ( @@ -31,7 +19,7 @@ const router = ( exact key={routeKey} path={route.to} - component={route.component} + component={routeNameToRouteComponent[routeKey]} /> ))} @@ -39,5 +27,3 @@ const router = ( ) export default router - -export { Link } from './router/Link' diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/test/vitest/setup.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/test/vitest/setup.ts index d263e51f4f..f62fc46590 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/test/vitest/setup.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/test/vitest/setup.ts @@ -1,4 +1,8 @@ -import matchers from '@testing-library/jest-dom/matchers' -import { expect } from 'vitest' +import { afterEach } from 'vitest' +import { cleanup } from '@testing-library/react' +import '@testing-library/jest-dom/vitest' -expect.extend(matchers) +// runs a clean after each test case (e.g. clearing jsdom) +afterEach(() => { + cleanup(); +}) diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/tsconfig.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/tsconfig.json index 968a1bb47f..4e7d14e1cd 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/tsconfig.json +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/tsconfig.json @@ -6,8 +6,14 @@ "allowJs": true, "strict": false, // Allow importing pages with the .tsx extension. - "allowImportingTsExtensions": true + "allowImportingTsExtensions": true, }, - "include": ["src"], - "references": [{ "path": "./tsconfig.node.json" }] -} + "include": [ + "src" + ], + "references": [ + { + "path": "./tsconfig.node.json" + } + ] +} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/vite.config.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/vite.config.ts index 0bc670f493..ed2d3dd5f0 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/vite.config.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/vite.config.ts @@ -1,13 +1,19 @@ /// import { mergeConfig } from "vite"; -import react from "@vitejs/plugin-react-swc"; +import react from "@vitejs/plugin-react"; +import { defaultExclude } from "vitest/config" -import customViteConfig from './src/ext-src/vite.config' +// Ignoring the TS error because we are importing a file outside of TS root dir. +// @ts-ignore +import customViteConfig from '../../../vite.config' const _waspUserProvidedConfig = customViteConfig const defaultViteConfig = { base: "/", plugins: [react()], + optimizeDeps: { + exclude: ['wasp'] + }, server: { port: 3000, host: "0.0.0.0", @@ -17,9 +23,22 @@ const defaultViteConfig = { build: { outDir: "build", }, + resolve: { + // These packages rely on a single instance per page. Not dedpuing them + // causes runtime errors (e.g., hook rule violation in react, QueryClient + // instance error in react-query, Invariant Error in react-router-dom). + dedupe: ["react", "react-dom", "@tanstack/react-query", "react-router-dom"] + }, test: { + globals: true, environment: "jsdom", - setupFiles: ["./src/test/vitest/setup.ts"], + // Since Vitest is running from the root of the project, we need + // to specify the path to the setup file relative to the root. + setupFiles: ['.wasp/out/web-app/src/test/vitest/setup.ts'], + exclude: [ + ...defaultExclude, + ".wasp/**/*", + ] }, }; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/api/events.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/api/events.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/api/events.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/api/events.ts diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/api.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/api/index.ts similarity index 92% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/api.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/api/index.ts index 17e36c1248..d066bd5448 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/api.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/api/index.ts @@ -1,10 +1,11 @@ import axios, { type AxiosError } from 'axios' -import config from './config' -import { storage } from './storage' -import { apiEventsEmitter } from './api/events' +import config from 'wasp/core/config' +import { storage } from 'wasp/core/storage' +import { apiEventsEmitter } from './events.js' -const api = axios.create({ +// PUBLIC API +export const api = axios.create({ baseURL: config.apiUrl, }) @@ -12,22 +13,26 @@ 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() @@ -66,6 +71,7 @@ window.addEventListener('storage', (event) => { } }) +// 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 @@ -100,5 +106,3 @@ class WaspHttpError extends Error { this.data = data } } - -export default api diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/types.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/index.ts similarity index 89% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/types.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/index.ts index 982b766e37..1972713940 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/types.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/index.ts @@ -1,3 +1,4 @@ +// PUBLIC API // NOTE: This is enough to cover Operations and our APIs (src/Wasp/AppSpec/Api.hs). export enum HttpMethod { Get = 'GET', @@ -6,4 +7,5 @@ export enum HttpMethod { Delete = 'DELETE', } +// PUBLIC API export type Route = { method: HttpMethod; path: string } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/actions/core.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts similarity index 73% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/actions/core.d.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts index fa31f329ff..894c01f91c 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/actions/core.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts @@ -1,6 +1,7 @@ -import { type Action } from '.' -import type { Expand, _Awaited, _ReturnType } from '../universal/types' +import { type Action } from '../core.js' +import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types' +// PRIVATE API export function createAction( actionRoute: string, entitiesUsed: unknown[] diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/actions/core.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/actions/core.js similarity index 90% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/actions/core.js rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/actions/core.js index 440e906140..17dd6aba4d 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/actions/core.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/actions/core.js @@ -1,9 +1,10 @@ -import { callOperation, makeOperationRoute } from '../operations' +import { callOperation, makeOperationRoute } from '../internal/index.js' import { registerActionInProgress, registerActionDone, -} from '../operations/resources' +} from '../internal/resources.js' +// PRIVATE API export function createAction(relativeActionRoute, entitiesUsed) { const actionRoute = makeOperationRoute(relativeActionRoute) @@ -22,7 +23,7 @@ export function createAction(relativeActionRoute, entitiesUsed) { // 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 + // 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 diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/actions/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/actions/index.ts new file mode 100644 index 0000000000..32207e1a69 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/web-app/src/actions/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/core.ts similarity index 64% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/actions/index.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/core.ts index 7fb2de2f9e..282c4698a7 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/actions/index.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/core.ts @@ -4,48 +4,95 @@ import { useMutation, UseMutationOptions, useQueryClient, -} from '@tanstack/react-query' -import { type Query } from '../queries'; + useQuery as rqUseQuery, + UseQueryResult, +} from "@tanstack/react-query"; +export { configureQueryClient } from "./queryClient"; -export type Action = - [Input] extends [never] ? - (args?: unknown) => Promise : - (args: Input) => Promise +// 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[] -} + optimisticUpdates: OptimisticUpdateDefinition[]; +}; +// PUBLIC API /** * A documented (public) way to define optimistic updates. */ export type OptimisticUpdateDefinition = { - getQuerySpecifier: GetQuerySpecifier - updateQuery: UpdateQuery -} + 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 +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 +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/data-model/operations/actions#the-useaction-hook-and-optimistic-updates + * https://wasp-lang.dev/docs/language/features#the-useaction-hook. */ -export type QuerySpecifier = [Query, ...any[]] +export type QuerySpecifier = [Query, ...any[]]; +// PUBLIC API /** * A hook for adding extra behavior to a Wasp Action (e.g., optimistic updates). * @@ -59,12 +106,20 @@ export function useAction( ): typeof actionFn { const queryClient = useQueryClient(); - let mutationFn = actionFn - let options = {} + let mutationFn = actionFn; + let options = {}; if (actionOptions?.optimisticUpdates) { - const optimisticUpdatesDefinitions = actionOptions.optimisticUpdates.map(translateToInternalDefinition) - mutationFn = makeOptimisticUpdateMutationFn(actionFn, optimisticUpdatesDefinitions) - options = makeRqOptimisticUpdateOptions(queryClient, optimisticUpdatesDefinitions) + 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., @@ -74,25 +129,24 @@ export function useAction( // 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) + 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, + 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 +type SpecificUpdateQuery = (oldData: CachedData) => CachedData; /** * A specific, "instantiated" optimistic update definition which contains a @@ -101,64 +155,73 @@ type SpecificUpdateQuery = (oldData: CachedData) => CachedData type SpecificOptimisticUpdateDefinition = { queryKey: QueryKey; updateQuery: SpecificUpdateQuery; -} +}; type InternalAction = Action & { internal( item: Input, optimisticUpdateDefinitions: SpecificOptimisticUpdateDefinition[] - ): Promise -} + ): 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/data-model/operations/actions#the-useaction-hook-and-optimistic-updates + * 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 { getQuerySpecifier, updateQuery } = publicOptimisticUpdateDefinition; - const definitionErrors = [] - if (typeof getQuerySpecifier !== 'function') { - definitionErrors.push('`getQuerySpecifier` is not a function.') + 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 (typeof updateQuery !== "function") { + definitionErrors.push("`updateQuery` is not a function."); } if (definitionErrors.length) { - throw new TypeError(`Invalid optimistic update definition: ${definitionErrors.join(', ')}.`) + 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[] + 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) - } + (generalDefinition) => + getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item) + ); + return (actionFn as InternalAction).internal( + item, + specificOptimisticUpdateDefinitions + ); + }; } /** @@ -168,7 +231,7 @@ function makeOptimisticUpdateMutationFn( * 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 @@ -179,40 +242,49 @@ function makeOptimisticUpdateMutationFn( */ function makeRqOptimisticUpdateOptions( queryClient: QueryClient, - optimisticUpdateDefinitions: InternalOptimisticUpdateDefinition[] + optimisticUpdateDefinitions: InternalOptimisticUpdateDefinition< + ActionInput, + CachedData + >[] ): Pick { async function onMutate(item) { const specificOptimisticUpdateDefinitions = optimisticUpdateDefinitions.map( - generalDefinition => getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item) - ) + (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) - )) + 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() + const previousData = new Map(); specificOptimisticUpdateDefinitions.forEach(({ queryKey, updateQuery }) => { // Snapshot the currently cached value. - const previousDataForQuery: CachedData = queryClient.getQueryData(queryKey) + const previousDataForQuery: CachedData = + queryClient.getQueryData(queryKey); // Attempt to optimistically update the cache using the new value. try { - queryClient.setQueryData(queryKey, updateQuery) + queryClient.setQueryData(queryKey, updateQuery); } catch (e) { - console.error("The `updateQuery` function threw an exception, skipping optimistic update:") - console.error(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) - }) + previousData.set(queryKey, previousDataForQuery); + }); - return { previousData } + return { previousData }; } function onError(_err, _item, context) { @@ -222,15 +294,15 @@ function makeRqOptimisticUpdateOptions( // 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) - }) + await queryClient.cancelQueries(queryKey); + queryClient.setQueryData(queryKey, data); + }); } return { onMutate, onError, - } + }; } /** @@ -246,24 +318,29 @@ function makeRqOptimisticUpdateOptions( * provided definition and closes over the provided item. */ function getOptimisticUpdateDefinitionForSpecificItem( - optimisticUpdateDefinition: InternalOptimisticUpdateDefinition, + optimisticUpdateDefinition: InternalOptimisticUpdateDefinition< + ActionInput, + CachedData + >, item: ActionInput ): SpecificOptimisticUpdateDefinition { - const { getQueryKey, updateQuery } = optimisticUpdateDefinition + const { getQueryKey, updateQuery } = optimisticUpdateDefinition; return { queryKey: getQueryKey(item), - updateQuery: (old) => updateQuery(item, old) - } + 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/data-model/operations/actions#the-useaction-hook-and-optimistic-updates + * 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] +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/out/sdk/wasp/client/operations/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/index.ts new file mode 100644 index 0000000000..ec9ca9f689 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/operations/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/internal/index.ts similarity index 81% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/operations/index.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/internal/index.ts index 2d4494b050..c274b5aa76 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/operations/index.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/internal/index.ts @@ -1,12 +1,14 @@ -import api, { handleApiError } from '../api' -import { HttpMethod } from '../types' -import { +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) @@ -17,6 +19,7 @@ export async function callOperation(operationRoute: OperationRoute & { method: H } } +// PRIVATE API export function makeOperationRoute(relativeOperationRoute: string): OperationRoute { return { method: HttpMethod.Post, path: `/${relativeOperationRoute}` } } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/operations/resources.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/internal/resources.js similarity index 97% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/operations/resources.js rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/internal/resources.js index 779cd55a5f..470ef70b82 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/operations/resources.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/internal/resources.js @@ -1,4 +1,4 @@ -import { queryClientInitialized } from '../queryClient' +import { queryClientInitialized } from '../queryClient.js' import { makeUpdateHandlersMap } from './updateHandlersMap' import { hashQueryKey } from '@tanstack/react-query' @@ -8,6 +8,8 @@ import { hashQueryKey } from '@tanstack/react-query' 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. diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/operations/updateHandlersMap.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/internal/updateHandlersMap.js similarity index 100% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/operations/updateHandlersMap.js rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/internal/updateHandlersMap.js diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/queries/core.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts similarity index 63% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/queries/core.d.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts index e1bdbe4783..ff8ae4a3b9 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/queries/core.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts @@ -1,19 +1,21 @@ -import { type Query } from '.' -import { Route } from '../types'; -import type { Expand, _Awaited, _ReturnType } from '../universal/types' +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[]; - }, + relativeQueryPath: string + queryRoute: Route + entitiesUsed: string[] + } ): void type QueryFor = Expand< diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/core.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/queries/core.js similarity index 69% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/core.js rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/queries/core.js index 5103db1d8b..c4b3e5f2e4 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/core.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/queries/core.js @@ -1,16 +1,17 @@ -import { callOperation, makeOperationRoute } from '../operations' +import { callOperation, makeOperationRoute } from '../internal/index.js' import { addResourcesUsedByQuery, getActiveOptimisticUpdates, -} from '../operations/resources' +} 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), + (result, update) => update(result), serverResult, ) } @@ -20,7 +21,11 @@ export function createQuery(relativeQueryPath, entitiesUsed) { return query } -export function addMetadataToQuery(query, { relativeQueryPath, queryRoute, entitiesUsed }) { +// 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/out/sdk/wasp/client/operations/queries/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/queries/index.ts new file mode 100644 index 0000000000..17f6f8e238 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/client/operations/queryClient.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/queryClient.ts new file mode 100644 index 0000000000..c2d1cb86df --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/web-app/src/router/Link.tsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/Link.tsx similarity index 91% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/router/Link.tsx rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/Link.tsx index df29edb857..2215ddc639 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/router/Link.tsx +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/Link.tsx @@ -1,10 +1,11 @@ import { useMemo } from 'react' import { Link as RouterLink } from 'react-router-dom' -import { type Routes } from '../router' import { interpolatePath } from './linkHelpers' +import { type Routes } from './index' type RouterLinkProps = Parameters[0] +// PUBLIC API export function Link( { to, params, search, hash, ...restOfProps }: Omit & { diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/index.ts new file mode 100644 index 0000000000..90f93b35f2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/web-app/src/router/linkHelpers.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/linkHelpers.ts similarity index 98% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/router/linkHelpers.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/linkHelpers.ts index 291d8238a3..e10cba9281 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/router/linkHelpers.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/linkHelpers.ts @@ -1,5 +1,6 @@ import type { Params, Search } from "./types"; +// PRIVATE API export function interpolatePath( path: string, params?: Params, diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/router/types.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/types.ts similarity index 91% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/router/types.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/types.ts index 0688d0bbba..ffaeb4fe01 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/router/types.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/router/types.ts @@ -1,13 +1,18 @@ +// 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 diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/test/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/test/index.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/test/index.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/test/index.ts diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/test/vitest/helpers.tsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/test/vitest/helpers.tsx similarity index 93% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/test/vitest/helpers.tsx rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/test/vitest/helpers.tsx index 4152191129..8ffbc9a7b4 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/test/vitest/helpers.tsx +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/test/vitest/helpers.tsx @@ -6,19 +6,20 @@ 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 '../../queries' -import config from '../../config' -import { HttpMethod, Route } from '../../types' - -export type { Route } from '../../types' +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 { @@ -39,6 +40,7 @@ export function renderInContext(ui: ReactElement): RenderResult { } } +// PUBLIC API export function mockServer(): { server: SetupServer mockQuery: MockQuery diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/config.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/core/config.ts similarity index 72% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/config.js rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/core/config.ts index c5d18dfed1..e9234e6f2a 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/config.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/core/config.ts @@ -1,4 +1,4 @@ -import { stripTrailingSlash } from "./universal/url"; +import { stripTrailingSlash } from 'wasp/universal/url' const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/storage.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/core/storage.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/storage.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/core/storage.ts diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dev/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dev/index.ts new file mode 100644 index 0000000000..e9bd93f7da --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/api/events.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/events.d.ts new file mode 100644 index 0000000000..c5f6b6e5da --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/api/events.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/events.js new file mode 100644 index 0000000000..b405507c51 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/api/events.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/events.js.map new file mode 100644 index 0000000000..de0637d22d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/api/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.d.ts new file mode 100644 index 0000000000..634416ecd5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/api/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.js new file mode 100644 index 0000000000..2015c488dc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/api/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.js.map new file mode 100644 index 0000000000..15be79e1ef --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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;CACvB,CAAC,CAAA;AAEF,MAAM,6BAA6B,GAAG,WAAW,CAAA;AAEjD,IAAI,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAuB,CAAA;AAE3F,oBAAoB;AACpB,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,oBAAoB,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,SAAS,CAAC,CAAA;IACrD,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;AACxC,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,YAAY;IAC1B,OAAO,oBAAoB,CAAA;AAC7B,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,cAAc;IAC5B,oBAAoB,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAA;IAC7C,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;AAC1C,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,mBAAmB;IACjC,oBAAoB,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,KAAK,EAAE,CAAA;IACf,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;AAC1C,CAAC;AAED,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;IACvC,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAChC,IAAI,SAAS,EAAE;QACb,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,SAAS,EAAE,CAAA;KACzD;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAC,CAAA;AAEF,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;;IACjD,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,MAAK,GAAG,EAAE;QAClC,cAAc,EAAE,CAAA;KACjB;IACD,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC,CAAC,CAAA;AAEF,kFAAkF;AAClF,2DAA2D;AAC3D,6EAA6E;AAC7E,0FAA0F;AAC1F,sFAAsF;AACtF,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;IAC3C,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,cAAc,CAAC,6BAA6B,CAAC,EAAE;QACvE,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE;YACpB,oBAAoB,GAAG,KAAK,CAAC,QAAQ,CAAA;YACrC,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;SACvC;aAAM;YACL,oBAAoB,GAAG,SAAS,CAAA;YAChC,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;SACzC;KACF;AACH,CAAC,CAAC,CAAA;AAEF,oBAAoB;AACpB;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAuD;;IACpF,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EAAE;QACnB,wEAAwE;QACxE,8CAA8C;QAC9C,8EAA8E;QAC9E,8BAA8B;QAC9B,yEAAyE;QACzE,iEAAiE;QACjE,iFAAiF;QACjF,MAAM,YAAY,GAAG,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,CAAA;QACzC,MAAM,kBAAkB,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAA;QAChD,MAAM,IAAI,aAAa,CAAC,kBAAkB,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,mCAAI,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;KAClG;SAAM;QACL,4CAA4C;QAC5C,MAAM,KAAK,CAAA;KACZ;AACH,CAAC;AAED,MAAM,aAAc,SAAQ,KAAK;IAK/B,YAAa,UAAkB,EAAE,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/out/sdk/wasp/dist/client/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.d.ts new file mode 100644 index 0000000000..fd6cf83b9e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.js new file mode 100644 index 0000000000..c13afdb0c7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.js.map new file mode 100644 index 0000000000..b7394b3505 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/actions/core.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts new file mode 100644 index 0000000000..e2c6699d11 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/actions/core.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js new file mode 100644 index 0000000000..51abcbe936 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/actions/core.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map new file mode 100644 index 0000000000..5834336f1d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/actions/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/actions/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/actions/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map new file mode 100644 index 0000000000..58e967cc07 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/core.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts new file mode 100644 index 0000000000..a23b24ebd6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/core.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/core.js new file mode 100644 index 0000000000..2c94cb01fd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/core.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/core.js.map new file mode 100644 index 0000000000..68ea114aa9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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,CAAC,GAAG,OAAO,CAAC,aAAa,EAAE,WAAW,CAAC;QACzC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC5B,OAAO,UAAU,iBACf,QAAQ,EACR,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,WAAW,CAAC,IAC1C,OAAO,EACV,CAAC;AACL,CAAC;AAmDD,aAAa;AACb;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CACvB,QAA+B,EAC/B,aAAoC;IAEpC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,IAAI,UAAU,GAAG,QAAQ,CAAC;IAC1B,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,iBAAiB,EAAE;QACpC,MAAM,4BAA4B,GAAG,aAAa,CAAC,iBAAiB,CAAC,GAAG,CACtE,6BAA6B,CAC9B,CAAC;QACF,UAAU,GAAG,8BAA8B,CACzC,QAAQ,EACR,4BAA4B,CAC7B,CAAC;QACF,OAAO,GAAG,6BAA6B,CACrC,WAAW,EACX,4BAA4B,CAC7B,CAAC;KACH;IAED,wEAAwE;IACxE,2EAA2E;IAC3E,wEAAwE;IACxE,4EAA4E;IAC5E,4EAA4E;IAC5E,sEAAsE;IACtE,0CAA0C;IAC1C,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAC9C,CAAC;AAiCD;;;;;;;;GAQG;AACH,SAAS,6BAA6B,CACpC,gCAA8E;IAE9E,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,GAAG,gCAAgC,CAAC;IAE5E,MAAM,gBAAgB,GAAG,EAAE,CAAC;IAC5B,IAAI,OAAO,iBAAiB,KAAK,UAAU,EAAE;QAC3C,gBAAgB,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;KACjE;IACD,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;QACrC,gBAAgB,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;KAC3D;IACD,IAAI,gBAAgB,CAAC,MAAM,EAAE;QAC3B,MAAM,IAAI,SAAS,CACjB,yCAAyC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACxE,CAAC;KACH;IAED,OAAO;QACL,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,0BAA0B,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC1E,WAAW;KACZ,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,8BAA8B,CACrC,QAA+B,EAC/B,2BAGG;IAEH,OAAO,SAAS,kCAAkC,CAAC,IAAI;QACrD,MAAM,mCAAmC,GAAG,2BAA2B,CAAC,GAAG,CACzE,CAAC,iBAAiB,EAAE,EAAE,CACpB,4CAA4C,CAAC,iBAAiB,EAAE,IAAI,CAAC,CACxE,CAAC;QACF,OAAQ,QAA0C,CAAC,QAAQ,CACzD,IAAI,EACJ,mCAAmC,CACpC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAS,6BAA6B,CACpC,WAAwB,EACxB,2BAGG;IAEH,KAAK,UAAU,QAAQ,CAAC,IAAI;QAC1B,MAAM,mCAAmC,GAAG,2BAA2B,CAAC,GAAG,CACzE,CAAC,iBAAiB,EAAE,EAAE,CACpB,4CAA4C,CAAC,iBAAiB,EAAE,IAAI,CAAC,CACxE,CAAC;QAEF,iFAAiF;QACjF,iEAAiE;QACjE,4EAA4E;QAC5E,mFAAmF;QACnF,MAAM,OAAO,CAAC,GAAG,CACf,mCAAmC,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CACvD,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,CACpC,CACF,CAAC;QAEF,4EAA4E;QAC5E,MAAM,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,mCAAmC,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE;YACxE,uCAAuC;YACvC,MAAM,oBAAoB,GACxB,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YAErC,kEAAkE;YAClE,IAAI;gBACF,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;aACjD;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,KAAK,CACX,4EAA4E,CAC7E,CAAC;gBACF,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aAClB;YAED,iEAAiE;YACjE,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,YAAY,EAAE,CAAC;IAC1B,CAAC;IAED,SAAS,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO;QACnC,+EAA+E;QAC/E,8EAA8E;QAC9E,8EAA8E;QAC9E,+EAA+E;QAC/E,YAAY;QACZ,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;YACpD,MAAM,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAC1C,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,QAAQ;QACR,OAAO;KACR,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,4CAA4C,CACnD,0BAGC,EACD,IAAiB;IAEjB,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,0BAA0B,CAAC;IAChE,OAAO;QACL,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC;QAC3B,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,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/out/sdk/wasp/dist/client/operations/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts new file mode 100644 index 0000000000..301165fa8e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/index.js new file mode 100644 index 0000000000..f83307c7b1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/index.js.map new file mode 100644 index 0000000000..982c957a9a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/internal/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts new file mode 100644 index 0000000000..e31c8b5a4b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/internal/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js new file mode 100644 index 0000000000..68bbdadf3d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/internal/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map new file mode 100644 index 0000000000..a4097ef8cb --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/internal/resources.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts new file mode 100644 index 0000000000..6f51eab82e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/internal/resources.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js new file mode 100644 index 0000000000..86ab763337 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/internal/resources.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map new file mode 100644 index 0000000000..c91fecd3c7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;KAC7B;AACH,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,sBAAsB;IAC7D,sBAAsB,CAAC,OAAO,CAC5B,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CACzE,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,SAAS,EAAE,sBAAsB;IACxE,sBAAsB,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAA;IACjF,MAAM,sBAAsB,CAAC,SAAS,CAAC,CAAA;AACzC,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,QAAQ;IACjD,OAAO,cAAc,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAA;AACnD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B;IAC9C,MAAM,WAAW,GAAG,MAAM,sBAAsB,CAAA;IAChD,wEAAwE;IACxE,8EAA8E;IAC9E,eAAe;IACf,iFAAiF;IACjF,6EAA6E;IAC7E,wFAAwF;IACxF,kFAAkF;IAClF,WAAW,CAAC,YAAY,EAAE,CAAA;IAC1B,6EAA6E;IAC7E,2DAA2D;IAC3D,WAAW,CAAC,aAAa,EAAE,CAAA;AAC7B,CAAC;AAED;;;GAGG;AACH,KAAK,UAAU,sBAAsB,CAAC,SAAS;IAC7C,MAAM,WAAW,GAAG,MAAM,sBAAsB,CAAA;IAEhD,MAAM,0BAA0B,GAAG,wBAAwB,CAAC,SAAS,CAAC,CAAA;IACtE,0BAA0B,CAAC,OAAO,CAChC,aAAa,CAAC,EAAE,CAAC,WAAW,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAC9D,CAAA;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,uBAAuB,CAAC,QAAQ;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/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts new file mode 100644 index 0000000000..715b6d06a1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js new file mode 100644 index 0000000000..34f590b5d2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map new file mode 100644 index 0000000000..7940fcd972 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/queries/core.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts new file mode 100644 index 0000000000..cf16c63f44 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/queries/core.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js new file mode 100644 index 0000000000..13b2cdcc9b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/queries/core.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map new file mode 100644 index 0000000000..f8ad3284bd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/queries/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts new file mode 100644 index 0000000000..575c502be1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/queries/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js new file mode 100644 index 0000000000..1c28e8d0d3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/queries/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map new file mode 100644 index 0000000000..5c83611fa3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/queryClient.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts new file mode 100644 index 0000000000..40df1fa863 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/queryClient.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js new file mode 100644 index 0000000000..9dfeab443f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/operations/queryClient.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map new file mode 100644 index 0000000000..82e2b19139 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/router/Link.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts new file mode 100644 index 0000000000..fe53898b9f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/router/Link.jsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/Link.jsx new file mode 100644 index 0000000000..d38b7a9c65 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/router/Link.jsx.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map new file mode 100644 index 0000000000..bb738bdad9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/router/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/index.d.ts new file mode 100644 index 0000000000..067b2fbd72 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/router/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/index.js new file mode 100644 index 0000000000..1a84b8d043 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/router/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/index.js.map new file mode 100644 index 0000000000..35eeff35e4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/router/linkHelpers.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts new file mode 100644 index 0000000000..22fd81ec79 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/router/linkHelpers.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js new file mode 100644 index 0000000000..144c9efc7c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/router/linkHelpers.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map new file mode 100644 index 0000000000..064bcce597 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/router/types.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/types.d.ts new file mode 100644 index 0000000000..80d69a3452 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/router/types.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/router/types.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/router/types.js.map new file mode 100644 index 0000000000..7d60d60505 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/test/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/test/index.d.ts new file mode 100644 index 0000000000..b684c869ea --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/test/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/test/index.js new file mode 100644 index 0000000000..be0d1c7d5a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/test/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/test/index.js.map new file mode 100644 index 0000000000..33c10677b9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts new file mode 100644 index 0000000000..645112861a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/test/vitest/helpers.jsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx new file mode 100644 index 0000000000..fcc9fc0b7a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map new file mode 100644 index 0000000000..de41e60937 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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,CAAA;AAC3D,OAAO,EAAE,IAAI,EAA2C,MAAM,KAAK,CAAA;AACnE,OAAO,EAAE,WAAW,EAAoB,MAAM,UAAU,CAAA;AACxD,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAgB,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEvD,OAAO,MAAM,MAAM,kBAAkB,CAAA;AACrC,OAAO,EAAE,UAAU,EAAS,MAAM,aAAa,CAAA;AAW/C,aAAa;AACb,+CAA+C;AAC/C,sIAAsI;AACtI,MAAM,UAAU,eAAe,CAAC,EAAgB;IAC9C,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAA;IAChC,MAAM,KAA0B,MAAM,CACpC,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAClC;MAAA,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CACtB;IAAA,EAAE,mBAAmB,CAAC,CACvB,EAJK,EAAE,QAAQ,OAIf,EAJoB,MAAM,cAArB,YAAuB,CAI5B,CAAA;IACD,uCACK,MAAM,KACT,QAAQ,EAAE,CAAC,UAAwB,EAAE,EAAE,CACrC,QAAQ,CACN,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAClC;UAAA,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,EAAE,MAAM,CAC9B;QAAA,EAAE,mBAAmB,CAAC,CACvB,IACJ;AACH,CAAC;AAED,aAAa;AACb,MAAM,UAAU,UAAU;IAKxB,MAAM,MAAM,GAAgB,WAAW,EAAE,CAAA;IAEzC,SAAS,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;IAChC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,CAAC,aAAa,EAAE,CAAA;QACtB,OAAO,EAAE,CAAA;IACX,CAAC,CAAC,CAAA;IACF,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAA;IAE9B,MAAM,SAAS,GAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC/C,MAAM,KAAK,GAAI,KAAqC,CAAC,KAAK,CAAA;QAC1D,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAC1C,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC5C,CAAA;IACH,CAAC,CAAA;IAED,MAAM,OAAO,GAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC3C,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;IACvE,CAAC,CAAA;IAED,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAA;AACvC,CAAC;AAED,SAAS,SAAS,CAChB,MAAmB,EACnB,KAAY,EACZ,eAAwD;IAExD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;QACrD,MAAM,IAAI,KAAK,CACb,yCACE,KAAK,CAAC,MACR,mCAAmC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC3E,CAAA;KACF;IAED,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IAE3C,MAAM,QAAQ,GAAyD;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/out/sdk/wasp/dist/core/config.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/core/config.d.ts new file mode 100644 index 0000000000..b567b37b9a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/core/config.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/core/config.js new file mode 100644 index 0000000000..85d8f7e943 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/core/config.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/core/config.js.map new file mode 100644 index 0000000000..aa55beed81 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/core/storage.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/core/storage.d.ts new file mode 100644 index 0000000000..1beeea0400 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/core/storage.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/core/storage.js new file mode 100644 index 0000000000..e54cbb3c51 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/core/storage.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/core/storage.js.map new file mode 100644 index 0000000000..b7cd5db441 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/dev/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/dev/index.d.ts new file mode 100644 index 0000000000..14157874a1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/dev/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/dev/index.js new file mode 100644 index 0000000000..bd25589418 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/dev/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/dev/index.js.map new file mode 100644 index 0000000000..6874fe15b7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/entities/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/entities/index.d.ts new file mode 100644 index 0000000000..0af05cd188 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/entities/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/entities/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/entities/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/entities/index.js.map new file mode 100644 index 0000000000..28316c97d8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/ext-src/MainPage.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts new file mode 100644 index 0000000000..891990a1cc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/ext-src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx new file mode 100644 index 0000000000..1ecd86d313 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/ext-src/MainPage.jsx.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map new file mode 100644 index 0000000000..bc78a183b9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/HttpError.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts new file mode 100644 index 0000000000..56b8d88eca --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/HttpError.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js new file mode 100644 index 0000000000..3e216e57ce --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js.map new file mode 100644 index 0000000000..34064e924c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/_types/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts new file mode 100644 index 0000000000..7f50bdcfce --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/_types/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/index.js new file mode 100644 index 0000000000..814a00a31f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/_types/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/index.js.map new file mode 100644 index 0000000000..692d12face --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/_types/serialization.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts new file mode 100644 index 0000000000..8338115ad9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/_types/serialization.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/serialization.js new file mode 100644 index 0000000000..085463a738 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/_types/serialization.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map new file mode 100644 index 0000000000..4be6f7733a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts new file mode 100644 index 0000000000..5e88022f3e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/_types/taggedEntities.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js new file mode 100644 index 0000000000..bf72aeef47 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/_types/taggedEntities.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map new file mode 100644 index 0000000000..d716981499 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/config.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.d.ts new file mode 100644 index 0000000000..223bb1b22c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js new file mode 100644 index 0000000000..6de1c8d25f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js.map new file mode 100644 index 0000000000..4b121ba37d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/dbClient.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts new file mode 100644 index 0000000000..396ea08918 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/dbClient.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/dbClient.js new file mode 100644 index 0000000000..a5d8ecd5d8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/dbClient.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/dbClient.js.map new file mode 100644 index 0000000000..677fd6e5d3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.d.ts new file mode 100644 index 0000000000..dee9613a53 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.js new file mode 100644 index 0000000000..0e53e0deab --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.js.map new file mode 100644 index 0000000000..b84ac1b303 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts new file mode 100644 index 0000000000..617cac8a78 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/middleware/globalMiddleware.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js new file mode 100644 index 0000000000..0926cba3d4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map new file mode 100644 index 0000000000..0490e6f7e3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/middleware/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts new file mode 100644 index 0000000000..4204eb294c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/middleware/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/index.js new file mode 100644 index 0000000000..db90d2875a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/middleware/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map new file mode 100644 index 0000000000..23374314b8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/operations/actions/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/operations/actions/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/operations/actions/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map new file mode 100644 index 0000000000..2735731598 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/operations/actions/types.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/operations/actions/types.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/operations/actions/types.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map new file mode 100644 index 0000000000..43367cc658 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/operations/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts new file mode 100644 index 0000000000..ee6ed4259c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/operations/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/index.js new file mode 100644 index 0000000000..dde0d8e4ae --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/operations/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/index.js.map new file mode 100644 index 0000000000..3e4a082c05 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/operations/queries/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/operations/queries/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/operations/queries/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map new file mode 100644 index 0000000000..d36dc482c2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/operations/queries/types.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/operations/queries/types.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/operations/queries/types.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map new file mode 100644 index 0000000000..c4eb8778e7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/types/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/types/index.d.ts new file mode 100644 index 0000000000..ce2e8cb99c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/types/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/types/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/types/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/types/index.js.map new file mode 100644 index 0000000000..4ab1f1d596 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/utils.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/utils.d.ts new file mode 100644 index 0000000000..266b9c6fbb --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/utils.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/utils.js new file mode 100644 index 0000000000..9b2034006b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/server/utils.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/utils.js.map new file mode 100644 index 0000000000..f3af561141 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/universal/types.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/types.d.ts new file mode 100644 index 0000000000..14dd465dca --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/universal/types.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/universal/types.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/types.js.map new file mode 100644 index 0000000000..8c06b33e94 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/universal/url.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/url.d.ts new file mode 100644 index 0000000000..aa893e7838 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/universal/url.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/url.js new file mode 100644 index 0000000000..988c0a67aa --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/universal/url.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/url.js.map new file mode 100644 index 0000000000..a7bad96020 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/dist/universal/validators.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/validators.d.ts new file mode 100644 index 0000000000..bd179246a1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/server/scripts/universal/validators.mjs b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/validators.js similarity index 91% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/scripts/universal/validators.mjs rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/validators.js index 9e3605d3b5..53462b3932 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/scripts/universal/validators.mjs +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/validators.js @@ -9,13 +9,14 @@ export function isValidAbsoluteURL(rawUrl) { "localhost:" and host of "3000" */ return url.protocol === "http:" || url.protocol === "https:"; - } catch (e) { + } + 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/out/sdk/wasp/dist/universal/validators.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/validators.js.map new file mode 100644 index 0000000000..313c98cef4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/server/src/entities/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/entities/index.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/entities/index.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/entities/index.ts diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/ext-src/Main.css b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/ext-src/Main.css similarity index 100% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/ext-src/Main.css rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/ext-src/Main.css diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/client/MainPage.jsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/ext-src/MainPage.jsx similarity index 81% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/client/MainPage.jsx rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/ext-src/MainPage.jsx index c53ad8abaa..01aae7c3db 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/client/MainPage.jsx +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/ext-src/MainPage.jsx @@ -1,7 +1,7 @@ -import waspLogo from './waspLogo.png' -import './Main.css' +import waspLogo from "./waspLogo.png"; +import "./Main.css"; -const MainPage = () => { +export function MainPage() { return (
@@ -9,7 +9,9 @@ const MainPage = () => { wasp
-

Welcome to Wasp - you just started a new app!

+

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

This is page MainPage located at route /. Open src/client/MainPage.jsx to edit it. @@ -35,6 +37,5 @@ const MainPage = () => { - ) + ); } -export default MainPage diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/ext-src/waspLogo.png b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/ext-src/waspLogo.png similarity index 100% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/ext-src/waspLogo.png rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/ext-src/waspLogo.png diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/package.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/package.json new file mode 100644 index 0000000000..5e4e77b7ce --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/package.json @@ -0,0 +1,101 @@ +{ + "dependencies": { + "@prisma/client": "4.16.2", + "@tanstack/react-query": "^4.29.0", + "@testing-library/jest-dom": "^6.3.0", + "@testing-library/react": "^14.1.2", + "@types/express-serve-static-core": "^4.17.13", + "@vitest/ui": "^1.2.1", + "axios": "^1.4.0", + "express": "~4.18.1", + "jsdom": "^21.1.1", + "jsonwebtoken": "^8.5.1", + "lodash.merge": "^4.6.2", + "mitt": "3.0.0", + "msw": "^1.1.0", + "prisma": "4.16.2", + "react": "^18.2.0", + "react-hook-form": "^7.45.4", + "react-router-dom": "^5.3.3", + "secure-password": "^4.0.0", + "sodium-native": "3.3.0", + "superjson": "^1.12.2", + "uuid": "^9.0.0", + "vitest": "^1.2.1" + }, + "devDependencies": { + "@tsconfig/node18": "latest" + }, + "exports": { + "./api/events": "./dist/api/events.js", + "./auth": "./dist/auth/index.js", + "./auth/helpers/user": "./dist/auth/helpers/user.js", + "./auth/jwt": "./dist/auth/jwt.js", + "./auth/pages/createAuthRequiredPage": "./dist/auth/pages/createAuthRequiredPage.jsx", + "./auth/password": "./dist/auth/password.js", + "./auth/providers/types": "./dist/auth/providers/types.js", + "./auth/session": "./dist/auth/session.js", + "./auth/utils": "./dist/auth/utils.js", + "./auth/validation": "./dist/auth/validation.js", + "./client": "./dist/client/index.js", + "./client/api": "./dist/api/index.js", + "./client/auth": "./dist/client/auth/index.js", + "./client/crud": "./dist/client/crud/index.js", + "./client/operations": "./dist/client/operations/index.js", + "./client/router": "./dist/client/router/index.js", + "./client/test": "./dist/client/test/index.js", + "./client/test/*": "./dist/client/test/*.js", + "./client/webSocket": "./dist/client/webSocket/index.js", + "./client/webSocket/WebSocketProvider": "./dist/client/webSocket/WebSocketProvider.jsx", + "./core/auth": "./dist/core/auth.js", + "./core/config": "./dist/core/config.js", + "./core/stitches.config": "./dist/core/stitches.config.js", + "./core/storage": "./dist/core/storage.js", + "./dev": "./dist/dev/index.js", + "./entities": "./dist/entities/index.js", + "./ext-src/*": "./dist/ext-src/*.js", + "./operations": "./dist/operations/index.js", + "./operations/*": "./dist/operations/*", + "./server": "./dist/server/index.js", + "./server/api": "./dist/server/api/index.js", + "./server/auth": "./dist/server/auth/index.js", + "./server/auth/email": "./dist/server/auth/email/index.js", + "./server/auth/email/utils": "./dist/server/auth/email/utils.js", + "./server/crud": "./dist/server/crud/index.js", + "./server/crud/*": "./dist/server/crud/*", + "./server/email": "./dist/server/email/index.js", + "./server/email/core/types": "./dist/server/email/core/types.js", + "./server/jobs": "./dist/server/jobs/index.js", + "./server/jobs/*": "./dist/server/jobs/*.js", + "./server/jobs/core/pgBoss": "./dist/server/jobs/core/pgBoss/index.js", + "./server/middleware": "./dist/server/middleware/index.js", + "./server/opeations/actions": "./dist/server/actions/index.js", + "./server/operations": "./dist/server/operations/index.js", + "./server/operations/queries": "./dist/server/queries/index.js", + "./server/types": "./dist/server/types/index.js", + "./server/utils": "./dist/server/utils.js", + "./server/webSocket": "./dist/server/webSocket/index.js", + "./universal/types": "./dist/universal/types.js", + "./universal/url": "./dist/universal/url.js", + "./universal/validators": "./dist/universal/validators.js" + }, + "include": [ + "src/**/*" + ], + "license": "ISC", + "name": "wasp", + "private": true, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "types": "tsc --declaration --emitDeclarationOnly --stripInternal --declarationDir dist" + }, + "type": "module", + "typesVersions": { + "*": { + "client/api": [ + "api/index.ts" + ] + } + }, + "version": "1.0.0" +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/core/HttpError.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/HttpError.ts similarity index 67% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/core/HttpError.js rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/HttpError.ts index 8a2cb04db5..3e8d3f5a0d 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/core/HttpError.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/HttpError.ts @@ -1,5 +1,8 @@ -class HttpError extends Error { - constructor (statusCode, message, data, ...params) { +export class HttpError extends Error { + public statusCode: number + public data: unknown + + constructor (statusCode: number, message?: string, data?: Record, ...params: unknown[]) { super(message, ...params) if (Error.captureStackTrace) { @@ -18,5 +21,3 @@ class HttpError extends Error { } } } - -export default HttpError diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/_types/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/_types/index.ts similarity index 93% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/_types/index.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/_types/index.ts index 189810ac8d..137aa69a91 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/_types/index.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/_types/index.ts @@ -1,7 +1,7 @@ -import { type Expand } from "../universal/types.js"; +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 "../dbClient.js" +import { prisma } from 'wasp/server' import { type _Entity } from "./taggedEntities" import { type Payload } from "./serialization"; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/_types/serialization.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/_types/serialization.ts similarity index 95% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/_types/serialization.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/_types/serialization.ts index 595b5ba69f..c8ff9c1ae3 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/_types/serialization.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/_types/serialization.ts @@ -18,7 +18,7 @@ export interface JSONObject { type PrimitiveJSONValue = string | number | boolean | undefined | null -interface JSONArray extends Array {} +export interface JSONArray extends Array {} type SerializableJSONValue = | Symbol diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/_types/taggedEntities.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts similarity index 94% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/_types/taggedEntities.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts index 6d3985f027..61c6677ae3 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/_types/taggedEntities.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts @@ -6,7 +6,7 @@ import { type Entity, type EntityName, -} from '../entities' +} from 'wasp/entities' export type _Entity = diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/config.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/config.ts similarity index 59% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/config.js rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/config.ts index 35ba136633..07c90ee26b 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/config.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/config.ts @@ -1,6 +1,6 @@ import merge from 'lodash.merge' -import { stripTrailingSlash } from "./universal/url.js"; +import { stripTrailingSlash } from "wasp/universal/url"; const env = process.env.NODE_ENV || 'development' @@ -9,23 +9,44 @@ const env = process.env.NODE_ENV || 'development' // - Use convict library to define schema and validate env vars. // https://codingsans.com/blog/node-config-best-practices -const config = { +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, - frontendUrl: undefined, allowedCORSOrigins: [], }, development: getDevelopmentConfig(), production: getProductionConfig(), } -const resolvedConfig = merge(config.all, config[env]) +const resolvedConfig: Config = merge(config.all, config[env]) +// PUBLIC API export default resolvedConfig -function getDevelopmentConfig() { +function getDevelopmentConfig(): EnvConfig { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); return { frontendUrl, @@ -33,7 +54,7 @@ function getDevelopmentConfig() { } } -function getProductionConfig() { +function getProductionConfig(): EnvConfig { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); return { frontendUrl, diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/dbClient.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/dbClient.ts new file mode 100644 index 0000000000..0084433d03 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/server/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/index.ts new file mode 100644 index 0000000000..535077900b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/server/middleware/globalMiddleware.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts new file mode 100644 index 0000000000..8bab5e4709 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/server/middleware/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/middleware/index.ts new file mode 100644 index 0000000000..50996ec27d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/server/operations/actions/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/operations/actions/index.ts new file mode 100644 index 0000000000..78b2ff0a44 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/server/operations/actions/types.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/operations/actions/types.ts new file mode 100644 index 0000000000..183065b864 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/server/operations/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/operations/index.ts new file mode 100644 index 0000000000..5d50ecb37b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/server/operations/queries/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/operations/queries/index.ts new file mode 100644 index 0000000000..78b2ff0a44 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/server/operations/queries/types.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/operations/queries/types.ts new file mode 100644 index 0000000000..a156fb294a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/server/src/types/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/types/index.ts similarity index 73% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/types/index.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/types/index.ts index b30c92f5ec..1bbffc7555 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/types/index.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/types/index.ts @@ -1,14 +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, } - -export type { Application } from 'express' -export type { Server } from 'http' - diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/utils.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/utils.ts similarity index 52% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/utils.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/utils.ts index 99492c5474..c8cc823348 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/utils.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/utils.ts @@ -32,33 +32,3 @@ async (req: RequestWithExtraFields, res: Response, next: NextFunction) => { } export const sleep = (ms: number): Promise => new Promise((r) => setTimeout(r, ms)) - -export function getDirPathFromFileUrl(fileUrl: string): string { - return fileURLToPath(dirname(fileUrl)) -} - -export async function importJsFilesFromDir( - pathToDir: string, - whitelistedFileNames: string[] | null = null -): Promise { - return new Promise((resolve, reject) => { - readdir(pathToDir, async (err, files) => { - if (err) { - return reject(err) - } - const importPromises = files - .filter((file) => file.endsWith('.js') && isWhitelistedFileName(file)) - .map((file) => import(`${pathToDir}/${file}`)) - resolve(Promise.all(importPromises)) - }) - }) - - function isWhitelistedFileName(fileName: string) { - // No whitelist means all files are whitelisted - if (!Array.isArray(whitelistedFileNames)) { - return true - } - - return whitelistedFileNames.some((whitelistedFileName) => fileName === whitelistedFileName) - } -} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/tsconfig.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/tsconfig.json new file mode 100644 index 0000000000..a7030c61d5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/server/src/universal/types.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/types.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/universal/types.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/types.ts diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/universal/url.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/url.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/universal/url.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/url.ts diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/validators.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/validators.ts new file mode 100644 index 0000000000..3d30d9622a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/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/out/sdk/wasp/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/.waspignore b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.waspignore similarity index 100% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/.waspignore rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.waspignore diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/main.wasp b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/main.wasp index 0b2cb79166..0d57f8f33f 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/main.wasp +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/main.wasp @@ -8,5 +8,5 @@ app waspBuild { route RootRoute { path: "/", to: MainPage } page MainPage { - component: import Main from "@client/MainPage.jsx" + component: import { MainPage } from "@src/MainPage.jsx" } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/package.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/package.json new file mode 100644 index 0000000000..36fbb8fcde --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/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/public/.gitkeep b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/public/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/client/Main.css b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/Main.css similarity index 100% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/client/Main.css rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/Main.css diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/ext-src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/MainPage.jsx similarity index 81% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/ext-src/MainPage.jsx rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/MainPage.jsx index c53ad8abaa..01aae7c3db 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/ext-src/MainPage.jsx +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/MainPage.jsx @@ -1,7 +1,7 @@ -import waspLogo from './waspLogo.png' -import './Main.css' +import waspLogo from "./waspLogo.png"; +import "./Main.css"; -const MainPage = () => { +export function MainPage() { return (
@@ -9,7 +9,9 @@ const MainPage = () => { wasp
-

Welcome to Wasp - you just started a new app!

+

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

This is page MainPage located at route /. Open src/client/MainPage.jsx to edit it. @@ -35,6 +37,5 @@ const MainPage = () => { - ) + ); } -export default MainPage diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/client/tsconfig.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/client/tsconfig.json deleted file mode 100644 index d501a4193a..0000000000 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/client/tsconfig.json +++ /dev/null @@ -1,55 +0,0 @@ -// =============================== IMPORTANT ================================= -// -// This file is only used for Wasp IDE support. You can change it to configure -// your IDE checks, but none of these options will affect the TypeScript -// compiler. Proper TS compiler configuration in Wasp is coming soon :) -{ - "compilerOptions": { - // JSX support - "jsx": "preserve", - "strict": true, - // Allow default imports. - "esModuleInterop": true, - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - // Wasp needs the following settings enable IDE support in your source - // files. Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/web-app/", - "paths": { - // Resolve all "@wasp" imports to the generated source code. - "@wasp/*": [ - "src/*" - ], - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": [ - "../../.wasp/out/web-app/node_modules/@types" - ], - // Since this TS config is used only for IDE support and not for - // compilation, the following directory doesn't exist. We need to specify - // it to prevent this error: - // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file - "outDir": "phantom" - }, - "exclude": [ - "phantom" - ], -} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/client/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/client/vite-env.d.ts deleted file mode 100644 index 1623b9c79c..0000000000 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/client/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/server/tsconfig.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/server/tsconfig.json deleted file mode 100644 index 70a79b44ee..0000000000 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/server/tsconfig.json +++ /dev/null @@ -1,48 +0,0 @@ -// =============================== IMPORTANT ================================= -// -// This file is only used for Wasp IDE support. You can change it to configure -// your IDE checks, but none of these options will affect the TypeScript -// compiler. Proper TS compiler configuration in Wasp is coming soon :) -{ - "compilerOptions": { - // Allows default imports. - "esModuleInterop": true, - "allowJs": true, - "strict": true, - // Wasp needs the following settings enable IDE support in your source - // files. Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/server/", - "paths": { - // Resolve all "@wasp" imports to the generated source code. - "@wasp/*": [ - "src/*" - ], - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": [ - "../../.wasp/out/server/node_modules/@types" - ], - // Since this TS config is used only for IDE support and not for - // compilation, the following directory doesn't exist. We need to specify - // it to prevent this error: - // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file - "outDir": "phantom", - }, - "exclude": [ - "phantom" - ], -} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/shared/tsconfig.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/shared/tsconfig.json deleted file mode 100644 index 20fcac8431..0000000000 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/shared/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - // Enable default imports in TypeScript. - "esModuleInterop": true, - "allowJs": true, - // The following settings enable IDE support in user-provided source files. - // Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/server/", - "paths": { - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": ["../../.wasp/out/server/node_modules/@types"] - } -} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/client/waspLogo.png b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/waspLogo.png similarity index 100% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/client/waspLogo.png rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/waspLogo.png diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/tsconfig.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/tsconfig.json new file mode 100644 index 0000000000..a05fb4efd3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/tsconfig.json @@ -0,0 +1,34 @@ +// =============================== IMPORTANT ================================= +// +// This file is only used for Wasp IDE support. You can change it to configure +// your IDE checks, but none of these options will affect the TypeScript +// compiler. Proper TS compiler configuration in Wasp is coming soon :) +{ + "compilerOptions": { + // JSX support + "jsx": "preserve", + "strict": true, + // Allow default imports. + "esModuleInterop": true, + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "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" + ], + // Since this TS config is used only for IDE support and not for + // compilation, the following directory doesn't exist. We need to specify + // it to prevent this error: + // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file + "outDir": "phantom", + }, + "exclude": [ + "phantom" + ], +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/ext-src/vite.config.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/vite.config.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/ext-src/vite.config.ts rename to waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/vite.config.ts diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest b/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest index 3c7ea01ae8..9fb7829e15 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest @@ -2,25 +2,196 @@ waspCompile/.wasp/out/.dockerignore waspCompile/.wasp/out/.waspchecksums waspCompile/.wasp/out/Dockerfile waspCompile/.wasp/out/db/schema.prisma -waspCompile/.wasp/out/installedFullStackNpmDependencies.json +waspCompile/.wasp/out/installedNpmDepsLog.json +waspCompile/.wasp/out/sdk/wasp/api/events.ts +waspCompile/.wasp/out/sdk/wasp/api/index.ts +waspCompile/.wasp/out/sdk/wasp/client/index.ts +waspCompile/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts +waspCompile/.wasp/out/sdk/wasp/client/operations/actions/core.js +waspCompile/.wasp/out/sdk/wasp/client/operations/actions/index.ts +waspCompile/.wasp/out/sdk/wasp/client/operations/core.ts +waspCompile/.wasp/out/sdk/wasp/client/operations/index.ts +waspCompile/.wasp/out/sdk/wasp/client/operations/internal/index.ts +waspCompile/.wasp/out/sdk/wasp/client/operations/internal/resources.js +waspCompile/.wasp/out/sdk/wasp/client/operations/internal/updateHandlersMap.js +waspCompile/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts +waspCompile/.wasp/out/sdk/wasp/client/operations/queries/core.js +waspCompile/.wasp/out/sdk/wasp/client/operations/queries/index.ts +waspCompile/.wasp/out/sdk/wasp/client/operations/queryClient.ts +waspCompile/.wasp/out/sdk/wasp/client/router/Link.tsx +waspCompile/.wasp/out/sdk/wasp/client/router/index.ts +waspCompile/.wasp/out/sdk/wasp/client/router/linkHelpers.ts +waspCompile/.wasp/out/sdk/wasp/client/router/types.ts +waspCompile/.wasp/out/sdk/wasp/client/test/index.ts +waspCompile/.wasp/out/sdk/wasp/client/test/vitest/helpers.tsx +waspCompile/.wasp/out/sdk/wasp/core/config.ts +waspCompile/.wasp/out/sdk/wasp/core/storage.ts +waspCompile/.wasp/out/sdk/wasp/dev/index.ts +waspCompile/.wasp/out/sdk/wasp/dist/api/events.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/api/events.js +waspCompile/.wasp/out/sdk/wasp/dist/api/events.js.map +waspCompile/.wasp/out/sdk/wasp/dist/api/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/api/index.js +waspCompile/.wasp/out/sdk/wasp/dist/api/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/client/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/index.js +waspCompile/.wasp/out/sdk/wasp/dist/client/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/core.js +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/core.js.map +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/index.js +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js +waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map +waspCompile/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/router/Link.jsx +waspCompile/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map +waspCompile/.wasp/out/sdk/wasp/dist/client/router/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/router/index.js +waspCompile/.wasp/out/sdk/wasp/dist/client/router/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js +waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map +waspCompile/.wasp/out/sdk/wasp/dist/client/router/types.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/router/types.js +waspCompile/.wasp/out/sdk/wasp/dist/client/router/types.js.map +waspCompile/.wasp/out/sdk/wasp/dist/client/test/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/test/index.js +waspCompile/.wasp/out/sdk/wasp/dist/client/test/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx +waspCompile/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map +waspCompile/.wasp/out/sdk/wasp/dist/core/config.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/core/config.js +waspCompile/.wasp/out/sdk/wasp/dist/core/config.js.map +waspCompile/.wasp/out/sdk/wasp/dist/core/storage.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/core/storage.js +waspCompile/.wasp/out/sdk/wasp/dist/core/storage.js.map +waspCompile/.wasp/out/sdk/wasp/dist/dev/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/dev/index.js +waspCompile/.wasp/out/sdk/wasp/dist/dev/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/entities/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/entities/index.js +waspCompile/.wasp/out/sdk/wasp/dist/entities/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx +waspCompile/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map +waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js +waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js.map +waspCompile/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/server/_types/index.js +waspCompile/.wasp/out/sdk/wasp/dist/server/_types/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/server/_types/serialization.js +waspCompile/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map +waspCompile/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js +waspCompile/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map +waspCompile/.wasp/out/sdk/wasp/dist/server/config.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/server/config.js +waspCompile/.wasp/out/sdk/wasp/dist/server/config.js.map +waspCompile/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/server/dbClient.js +waspCompile/.wasp/out/sdk/wasp/dist/server/dbClient.js.map +waspCompile/.wasp/out/sdk/wasp/dist/server/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/server/index.js +waspCompile/.wasp/out/sdk/wasp/dist/server/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js +waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map +waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/index.js +waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js +waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js +waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map +waspCompile/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/server/operations/index.js +waspCompile/.wasp/out/sdk/wasp/dist/server/operations/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js +waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js +waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map +waspCompile/.wasp/out/sdk/wasp/dist/server/types/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/server/types/index.js +waspCompile/.wasp/out/sdk/wasp/dist/server/types/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/server/utils.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/server/utils.js +waspCompile/.wasp/out/sdk/wasp/dist/server/utils.js.map +waspCompile/.wasp/out/sdk/wasp/dist/universal/types.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/universal/types.js +waspCompile/.wasp/out/sdk/wasp/dist/universal/types.js.map +waspCompile/.wasp/out/sdk/wasp/dist/universal/url.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/universal/url.js +waspCompile/.wasp/out/sdk/wasp/dist/universal/url.js.map +waspCompile/.wasp/out/sdk/wasp/dist/universal/validators.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/universal/validators.js +waspCompile/.wasp/out/sdk/wasp/dist/universal/validators.js.map +waspCompile/.wasp/out/sdk/wasp/entities/index.ts +waspCompile/.wasp/out/sdk/wasp/ext-src/Main.css +waspCompile/.wasp/out/sdk/wasp/ext-src/MainPage.jsx +waspCompile/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts +waspCompile/.wasp/out/sdk/wasp/ext-src/waspLogo.png +waspCompile/.wasp/out/sdk/wasp/package.json +waspCompile/.wasp/out/sdk/wasp/server/HttpError.ts +waspCompile/.wasp/out/sdk/wasp/server/_types/index.ts +waspCompile/.wasp/out/sdk/wasp/server/_types/serialization.ts +waspCompile/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts +waspCompile/.wasp/out/sdk/wasp/server/config.ts +waspCompile/.wasp/out/sdk/wasp/server/dbClient.ts +waspCompile/.wasp/out/sdk/wasp/server/index.ts +waspCompile/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts +waspCompile/.wasp/out/sdk/wasp/server/middleware/index.ts +waspCompile/.wasp/out/sdk/wasp/server/operations/actions/index.ts +waspCompile/.wasp/out/sdk/wasp/server/operations/actions/types.ts +waspCompile/.wasp/out/sdk/wasp/server/operations/index.ts +waspCompile/.wasp/out/sdk/wasp/server/operations/queries/index.ts +waspCompile/.wasp/out/sdk/wasp/server/operations/queries/types.ts +waspCompile/.wasp/out/sdk/wasp/server/types/index.ts +waspCompile/.wasp/out/sdk/wasp/server/utils.ts +waspCompile/.wasp/out/sdk/wasp/tsconfig.json +waspCompile/.wasp/out/sdk/wasp/universal/types.ts +waspCompile/.wasp/out/sdk/wasp/universal/url.ts +waspCompile/.wasp/out/sdk/wasp/universal/validators.ts +waspCompile/.wasp/out/sdk/wasp/vite-env.d.ts waspCompile/.wasp/out/server/.env waspCompile/.wasp/out/server/.npmrc waspCompile/.wasp/out/server/README.md waspCompile/.wasp/out/server/nodemon.json waspCompile/.wasp/out/server/package.json -waspCompile/.wasp/out/server/scripts/universal/validators.mjs +waspCompile/.wasp/out/server/rollup.config.js waspCompile/.wasp/out/server/scripts/validate-env.mjs -waspCompile/.wasp/out/server/src/_types/index.ts -waspCompile/.wasp/out/server/src/_types/serialization.ts -waspCompile/.wasp/out/server/src/_types/taggedEntities.ts waspCompile/.wasp/out/server/src/actions/types.ts waspCompile/.wasp/out/server/src/app.js -waspCompile/.wasp/out/server/src/config.js -waspCompile/.wasp/out/server/src/core/AuthError.js -waspCompile/.wasp/out/server/src/core/HttpError.js -waspCompile/.wasp/out/server/src/dbClient.ts -waspCompile/.wasp/out/server/src/dbSeed/types.ts -waspCompile/.wasp/out/server/src/entities/index.ts waspCompile/.wasp/out/server/src/middleware/globalMiddleware.ts waspCompile/.wasp/out/server/src/middleware/index.ts waspCompile/.wasp/out/server/src/middleware/operations.ts @@ -29,10 +200,6 @@ waspCompile/.wasp/out/server/src/queries/types.ts waspCompile/.wasp/out/server/src/routes/index.js waspCompile/.wasp/out/server/src/routes/operations/index.js waspCompile/.wasp/out/server/src/server.ts -waspCompile/.wasp/out/server/src/types/index.ts -waspCompile/.wasp/out/server/src/universal/types.ts -waspCompile/.wasp/out/server/src/universal/url.ts -waspCompile/.wasp/out/server/src/utils.ts waspCompile/.wasp/out/server/tsconfig.json waspCompile/.wasp/out/web-app/.env waspCompile/.wasp/out/web-app/.npmrc @@ -40,56 +207,29 @@ waspCompile/.wasp/out/web-app/README.md waspCompile/.wasp/out/web-app/index.html waspCompile/.wasp/out/web-app/netlify.toml waspCompile/.wasp/out/web-app/package.json +waspCompile/.wasp/out/web-app/public/.gitkeep waspCompile/.wasp/out/web-app/public/favicon.ico waspCompile/.wasp/out/web-app/public/manifest.json -waspCompile/.wasp/out/web-app/scripts/universal/validators.mjs waspCompile/.wasp/out/web-app/scripts/validate-env.mjs -waspCompile/.wasp/out/web-app/src/actions/core.d.ts -waspCompile/.wasp/out/web-app/src/actions/core.js -waspCompile/.wasp/out/web-app/src/actions/index.ts -waspCompile/.wasp/out/web-app/src/api.ts -waspCompile/.wasp/out/web-app/src/api/events.ts -waspCompile/.wasp/out/web-app/src/config.js waspCompile/.wasp/out/web-app/src/entities/index.ts -waspCompile/.wasp/out/web-app/src/ext-src/Main.css -waspCompile/.wasp/out/web-app/src/ext-src/MainPage.jsx -waspCompile/.wasp/out/web-app/src/ext-src/vite-env.d.ts -waspCompile/.wasp/out/web-app/src/ext-src/vite.config.ts -waspCompile/.wasp/out/web-app/src/ext-src/waspLogo.png waspCompile/.wasp/out/web-app/src/index.tsx waspCompile/.wasp/out/web-app/src/logo.png -waspCompile/.wasp/out/web-app/src/operations/index.ts -waspCompile/.wasp/out/web-app/src/operations/resources.js -waspCompile/.wasp/out/web-app/src/operations/updateHandlersMap.js -waspCompile/.wasp/out/web-app/src/queries/core.d.ts -waspCompile/.wasp/out/web-app/src/queries/core.js -waspCompile/.wasp/out/web-app/src/queries/index.d.ts -waspCompile/.wasp/out/web-app/src/queries/index.js waspCompile/.wasp/out/web-app/src/queryClient.js waspCompile/.wasp/out/web-app/src/router.tsx -waspCompile/.wasp/out/web-app/src/router/Link.tsx -waspCompile/.wasp/out/web-app/src/router/linkHelpers.ts -waspCompile/.wasp/out/web-app/src/router/types.ts -waspCompile/.wasp/out/web-app/src/storage.ts -waspCompile/.wasp/out/web-app/src/test/index.ts -waspCompile/.wasp/out/web-app/src/test/vitest/helpers.tsx waspCompile/.wasp/out/web-app/src/test/vitest/setup.ts -waspCompile/.wasp/out/web-app/src/types.ts -waspCompile/.wasp/out/web-app/src/universal/types.ts -waspCompile/.wasp/out/web-app/src/universal/url.ts waspCompile/.wasp/out/web-app/src/utils.js waspCompile/.wasp/out/web-app/src/vite-env.d.ts waspCompile/.wasp/out/web-app/tsconfig.json waspCompile/.wasp/out/web-app/tsconfig.node.json waspCompile/.wasp/out/web-app/vite.config.ts +waspCompile/.waspignore waspCompile/.wasproot waspCompile/main.wasp -waspCompile/src/.waspignore -waspCompile/src/client/Main.css -waspCompile/src/client/MainPage.jsx -waspCompile/src/client/tsconfig.json -waspCompile/src/client/vite-env.d.ts -waspCompile/src/client/vite.config.ts -waspCompile/src/client/waspLogo.png -waspCompile/src/server/tsconfig.json -waspCompile/src/shared/tsconfig.json +waspCompile/package.json +waspCompile/public/.gitkeep +waspCompile/src/Main.css +waspCompile/src/MainPage.jsx +waspCompile/src/vite-env.d.ts +waspCompile/src/waspLogo.png +waspCompile/tsconfig.json +waspCompile/vite.config.ts diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/.waspchecksums b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/.waspchecksums index cb531d0c2e..e6242905d0 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/.waspchecksums @@ -2,555 +2,632 @@ [ [ "file", - ".dockerignore" + "../out/sdk/wasp/api/events.ts" ], - "a2a5ebe3785244437c0d490b4bfa1652c84b9ab0d4f25566fd7e69d1421d7a1b" + "91ec1889f649b608ca81cab8f048538b9dcc70f49444430b1e5b572af2a4970a" ], [ [ "file", - "Dockerfile" + "../out/sdk/wasp/api/index.ts" ], - "61df2044110c16c48bfe89f0798c689c256598cb6cbc37f9ea69b69ee6ffe2a4" + "6d69f0df651dd19d0a9cd137ee4a0d536358269b6bd91c25efaa6c254f06948a" ], [ [ "file", - "db/schema.prisma" + "../out/sdk/wasp/client/index.ts" ], - "93f3b154b04fce7819e24aeb1691cd1c78f731f41a2f9e0213d54ef783f2bc38" + "526d2f787c68b0be87064eb4c7771394f2987b6669b5fd39f9d240dcbfc2356c" ], [ [ "file", - "server/.env" + "../out/sdk/wasp/client/operations/actions/core.d.ts" ], - "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + "676855c039620769cc6ac728149d263c438024e5888ea0afd7f575507a95682a" ], [ [ "file", - "server/.gitignore" + "../out/sdk/wasp/client/operations/actions/core.js" ], - "2c3d81dd719ff91d51609a02d03ba62ad456e2c50763b7b4c761395cb583f890" + "620a4aefbab701dd47b8bf21a07fc4e081ae1fd297261c5af7a05f21f558dff1" ], [ [ "file", - "server/.npmrc" + "../out/sdk/wasp/client/operations/actions/index.ts" ], - "8a74b1091affea3c71c2cf04acbaa38c4a51a261a9a98dcc9e96473d07a85a27" + "cada58ebdd19f239b97a4cc6bfc1d37b855022629457ddb0c03ff9317aa8e8f0" ], [ [ "file", - "server/README.md" + "../out/sdk/wasp/client/operations/core.ts" ], - "e14514b8b152dd2160a217d8fc66a710c8607c4ed1441a2148a0770701818249" + "bad860771b16a0d4830fab22de8b85e63c840d47dc3728728a23b8ada91061ef" ], [ [ "file", - "server/nodemon.json" + "../out/sdk/wasp/client/operations/index.ts" ], - "c4c69994805c8e0d993bd39fec9e52478b5e656bae565fa1c19ef378901a7139" + "4a66c90319dd7ef0d3a8e6c1f571037c7dfd9778b9def6e951813dbc4b4dcef3" ], [ [ "file", - "server/package.json" + "../out/sdk/wasp/client/operations/internal/index.ts" ], - "72e5881bb95ccc51f16d4bc27e45f9203aba6a96c814d4626f2abf8906a8cd61" + "0cd5c744f0d883d48a6c1ddf8eacbe48059e123e79c5f39fad2d17073b6c9f9e" ], [ [ "file", - "server/scripts/universal/validators.mjs" + "../out/sdk/wasp/client/operations/internal/resources.js" ], - "94edf3906c43fb476b22244d07a5d69fd6c967de767532ed5b3215e2a6eee91b" + "0f3a0e4d19ceff419a6343ab5162d8b0985673f9d3d7d76bd4471fae0076fe17" ], [ [ "file", - "server/scripts/validate-env.mjs" + "../out/sdk/wasp/client/operations/internal/updateHandlersMap.js" ], - "b507ff0f8cbdac18a0b42ccbb7acda9a5cd88e0ac5f95ca3d42341944298062d" + "07a9933a771853585fd2fc49c3dcb9f1cad947acb2168580c835fae25620fa9f" ], [ [ "file", - "server/src/_types/index.ts" + "../out/sdk/wasp/client/operations/queries/core.d.ts" ], - "b6b5d08ff823cf66d47932167a4008307acb53cef2e409f26621e8b268ba8008" + "8ca19541652926772e2a7c5d88b5497b7760e98bc9d19c9a217bd03d83cec97d" ], [ [ "file", - "server/src/_types/serialization.ts" + "../out/sdk/wasp/client/operations/queries/core.js" ], - "73dc983c9a02cab8e2f189f1ddedd9cdcd47bf403c9dc56efba8be895b6980a1" + "34425abc901cd6294ca902df6b0c080aeafe2b3abf5b539c5e622020601f838e" ], [ [ "file", - "server/src/_types/taggedEntities.ts" + "../out/sdk/wasp/client/operations/queries/index.ts" ], - "783703d6c7174bc262778598da7e24b1c9727e4fd1826f5d9a947ab701fe0977" + "9d188907e5a3175e1bdada1c242ee4741eb866598d06d9d71d73a01e7a9a8ba2" ], [ [ "file", - "server/src/actions/types.ts" + "../out/sdk/wasp/client/operations/queryClient.ts" ], - "a994ed1f89011c04014deb57a2c26d09c216491caac9269380a7c14d1718b313" + "5c1d87ac10513788bcde7ebc7c10601b9ad0854cddff355e8fb7e2d4685ecdef" ], [ [ "file", - "server/src/app.js" + "../out/sdk/wasp/client/router/Link.tsx" + ], + "80db39a38f50833f8c965bfd7758da990083db60a6f2f8e394353eed5f981cc9" + ], + [ + [ + "file", + "../out/sdk/wasp/client/router/index.ts" ], - "86504ede1daeca35cc93f665ca8ac2fdf46ecaff02f6d3a7810a14d2bc71e16a" + "6fe430c2956c25c3833d6893c695523a7b2a5f1cb9eceb0bed26429c2e33e6a0" ], [ [ "file", - "server/src/config.js" + "../out/sdk/wasp/client/router/linkHelpers.ts" ], - "d135535e045e5f5852e0b6d8bd49360e7231021cd38b540f419f5f44c6158dc2" + "62e48c724070c59a95c837288112922326e1351ee1defa4759bdc47f7361ce9e" ], [ [ "file", - "server/src/core/AuthError.js" + "../out/sdk/wasp/client/router/types.ts" ], - "5ac18ed20c5c8b192a75d1cb2f36906d5ff9f0951451a2ef08d9ab62fc26b8bb" + "d6feb23110d8cae5c94badd5cdec320207e1a5406cb827eb684aa4cffc3d7050" ], [ [ "file", - "server/src/core/HttpError.js" + "../out/sdk/wasp/client/test/index.ts" ], - "fa06ff60ab8183e8d00c13805692fc8cd3b5a21408edce4f0949d5b913e066b1" + "cb2e2dc33df8afc0d4453f4322a4e2af92f3345e9622e0416fa87e34d6acb9d8" + ], + [ + [ + "file", + "../out/sdk/wasp/client/test/vitest/helpers.tsx" + ], + "e0fbaf237a21b52ff47897fb1f1b1bffb0085670b71ba7d0b1d90547ab5a8f3b" ], [ [ "file", - "server/src/dbClient.ts" + "../out/sdk/wasp/core/config.ts" ], - "f26bfa4a60022d45195f3179548c4b09305f6a9cfe301b5edd1615677a59ae3f" + "12a7dffb1c3fe762cec8d9d928af353cb169ff199d3934b1f3c27ce0e3a2f987" + ], + [ + [ + "file", + "../out/sdk/wasp/core/storage.ts" + ], + "e9e2a4a02d48bea1597fcdc00592e3d975eea7fa6e0545cf087da9429c5f4979" ], [ [ "file", - "server/src/dbSeed/types.ts" + "../out/sdk/wasp/dev/index.ts" ], - "47442c546d286164c2cdb3359deb45b47f115df2ca72bb181b4639bee2059d38" + "1c15a2858ffe39f3ef83e53705cb25b00f09e895c04cf1a354210b5babdde895" ], [ [ "file", - "server/src/entities/index.ts" + "../out/sdk/wasp/entities/index.ts" ], "c59b97b122b977b5171686c92ee5ff2d80d397c2e83cc0915affb6ee136406fb" ], [ [ "file", - "server/src/middleware/globalMiddleware.ts" + "../out/sdk/wasp/ext-src/Main.css" ], - "5ecfd79481386c7ba17747a6d786166c8a7f95e331462d15303e1abf7cd031b7" + "1583ce49887ea575e563dab0c7ad6d2e2e3e6a351ed7c2f80c310641b1456417" ], [ [ "file", - "server/src/middleware/index.ts" + "../out/sdk/wasp/ext-src/MainPage.jsx" ], - "e658719309f9375f389c5d8d416fc27f9c247049e61188b3e01df954bcec15a4" + "4aead352bd5bbb5134b5e1f0927cf94966d80aa9dbbbb1f616e79fec8ae594e4" ], [ [ "file", - "server/src/middleware/operations.ts" + "../out/sdk/wasp/ext-src/vite-env.d.ts" ], - "864c7492c27f6da1e67645fbc358dc803a168852bfd24f2c4dd13fccf6917b07" + "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5" ], [ [ "file", - "server/src/polyfill.ts" + "../out/sdk/wasp/ext-src/waspLogo.png" ], - "66d3dca514bdd01be402714d0dfe3836e76f612346dea57ee595ae4f3da915cf" + "0f05a89eb945d6d7326110e88776e402833b356202b06d0a8bf652e118d3fd2f" ], [ [ "file", - "server/src/queries/types.ts" + "../out/sdk/wasp/package.json" ], - "276f022c04936bfe75d593fe8426a0aaf43a0e9c085042ad1b6560ad23041031" + "8c4e7254985043dbada72ea8caa14dc82e154e5d1d3384677b7986f9ba8ef833" ], [ [ "file", - "server/src/routes/index.js" + "../out/sdk/wasp/server/HttpError.ts" ], - "c34f77a96150414957386f5645c9becb12725c9f231aaaa8db798e3564bd75ce" + "eaa296c30acc65c78b90ebdf9a1d6fdb863f0c26c743d352afaeaa3bbc2fdd1b" ], [ [ "file", - "server/src/routes/operations/index.js" + "../out/sdk/wasp/server/_types/index.ts" ], - "d09f7dcf78ed2da15f488afb08e62d9dac15f173fdbe779323dfdd75330f5de5" + "2eb94c60f2031ae3ea023de5aa938b3aeabba31388a7f8bdcdee432bbef3f517" ], [ [ "file", - "server/src/server.ts" + "../out/sdk/wasp/server/_types/serialization.ts" ], - "d0666b659cdc75db181ea2bbb50c4e157f0a7fbe00c4ff8fda0933b1a13e5a0e" + "cfa5bcdd91e36fe35a91323bd3944a52873144101a5a03ae8a4f258cdd61ea03" ], [ [ "file", - "server/src/types/index.ts" + "../out/sdk/wasp/server/_types/taggedEntities.ts" ], - "f7621082fc7d8467a0967eb0bd82ff7956052b766e9e82d50584b8de88e0d28a" + "94a8c58d122296edd8803618b878c66dc1ce27035735f31bb97d6a58be219324" ], [ [ "file", - "server/src/universal/types.ts" + "../out/sdk/wasp/server/config.ts" ], - "8ef378c1447289104856ec1a92931fd1280c0f8d0a8463008674e93bd798b884" + "4976e545d8fcf019508e95f472305e9ef27dfb3423c71e428a5414e35cdd52be" ], [ [ "file", - "server/src/universal/url.ts" + "../out/sdk/wasp/server/dbClient.ts" ], - "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" + "50f11eb232174184be5fd44e8ee3875c30707b486c8c70c3f7bfb93609d38e66" ], [ [ "file", - "server/src/utils.ts" + "../out/sdk/wasp/server/index.ts" ], - "6a664e44a89efe8ed8cb7559a84bd2871422c38287b276fee2a7aed4680e1d1e" + "51c3e0802764f72b88f6daaf148dba514ae817e233a40cc9b92ec91784f71f98" ], [ [ "file", - "server/tsconfig.json" + "../out/sdk/wasp/server/middleware/globalMiddleware.ts" ], - "51a60d6350537a9e0696674aae86b122a7dea2a4497d294fd4fd6bc47b7e9808" + "53f258be83ca6de653b6b645253ce573e3c177e88017eb2adb17f5d3cebb36c3" ], [ [ "file", - "web-app/.env" + "../out/sdk/wasp/server/middleware/index.ts" ], - "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + "e658719309f9375f389c5d8d416fc27f9c247049e61188b3e01df954bcec15a4" ], [ [ "file", - "web-app/.gitignore" + "../out/sdk/wasp/server/operations/actions/index.ts" ], - "d373417ea2a8844e3b7a1515aab123e90fbeb4b7225144d55d243d9f6f04f73a" + "c67a0c7d8946f5c465edea2de78e78537384bd6f30ec4f4fd6dfe58243f4f36a" ], [ [ "file", - "web-app/.npmrc" + "../out/sdk/wasp/server/operations/actions/types.ts" ], - "7151cf397def0c2cb0ab65643701d27d335a72c90f775675b5f826bc7005818a" + "cc03111599e32695d677e8ac4e65b98cf90e0cb066e71c3da06af254c784b489" ], [ [ "file", - "web-app/README.md" + "../out/sdk/wasp/server/operations/index.ts" ], - "6af47b8c26fa9d30e9b774e6c38d3456a3b469c3101bffb186e2a1fb325a93f4" + "b185af725a91995c8eb76d1c3560a488e9caef664d0add8620e2ea387e2be7f8" ], [ [ "file", - "web-app/index.html" + "../out/sdk/wasp/server/operations/queries/index.ts" ], - "f38792224e7db1569c41ec117a2cb211dec4620b8b4302c47ff7fc8f58ce3647" + "c67a0c7d8946f5c465edea2de78e78537384bd6f30ec4f4fd6dfe58243f4f36a" ], [ [ "file", - "web-app/netlify.toml" + "../out/sdk/wasp/server/operations/queries/types.ts" ], - "854009c7d1b2630a55099439f89e4947188ea4160c9d1388b46b5a5cf6ab461a" + "19f72a3a37efd1e29b0793caa7f379494ad236bb513c8c8804b5a8d305c45196" ], [ [ "file", - "web-app/package.json" + "../out/sdk/wasp/server/types/index.ts" ], - "f5cf65d2b1f2f48b71c79679e6cacbc709140795a198472e5f8626a13bdb01e1" + "0f2ffdfdd76c92084bd0ba270b674628ec907da0d047de6c8a9912e415462d97" ], [ [ "file", - "web-app/public/favicon.ico" + "../out/sdk/wasp/server/utils.ts" ], - "1481f03584b46b63182c1f8d26e61a95ce4d8fae032b2b4f3fe5e00ab7e96c23" + "a4178a3e2527d47d141340b99abf675125859fa9cb5a0535e3efa7b34a3bcabb" ], [ [ "file", - "web-app/public/manifest.json" + "../out/sdk/wasp/tsconfig.json" ], - "434b67f4ee148d6a5c8d88879b616d0af36d71abf193e84ef247e5ab959a13bd" + "5a1d45e247132b9afbfabb9073749a924a86bfefe945a954c1f44ec672e1fef3" ], [ [ "file", - "web-app/scripts/universal/validators.mjs" + "../out/sdk/wasp/universal/types.ts" ], - "94edf3906c43fb476b22244d07a5d69fd6c967de767532ed5b3215e2a6eee91b" + "8ef378c1447289104856ec1a92931fd1280c0f8d0a8463008674e93bd798b884" ], [ [ "file", - "web-app/scripts/validate-env.mjs" + "../out/sdk/wasp/universal/url.ts" ], - "690460410bc9b28a8e96c6e20902e841f07b77faccf3db7e7249f48f700f4bab" + "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" ], [ [ "file", - "web-app/src/actions/core.d.ts" + "../out/sdk/wasp/universal/validators.ts" ], - "34b44699906b98ca28050479b66254e64073a403b571a8fd1a227395d27becae" + "80c624ff5caa11fcaa66c74eb3a473dbedc9bbac3ece740361d7752f5f45d38f" ], [ [ "file", - "web-app/src/actions/core.js" + "../out/sdk/wasp/vite-env.d.ts" ], - "f38003d51d9754952bf595a25fdb44580d88af3bcd6658848cf8a339a8240689" + "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5" ], [ [ "file", - "web-app/src/actions/index.ts" + ".dockerignore" ], - "607c3311861456ae47c246a950c8e29593f9837a9f5c48923d99cd7fac1ce0bb" + "a2a5ebe3785244437c0d490b4bfa1652c84b9ab0d4f25566fd7e69d1421d7a1b" ], [ [ "file", - "web-app/src/api.ts" + "Dockerfile" ], - "850331885230117aa56317186c6d38f696fb1fbd0c56470ff7c6e4f3c1c43104" + "ab6bdf75fb4a56816d65231773dcce1f7133b18da6803f2b035f35bf124ea1c0" ], [ [ "file", - "web-app/src/api/events.ts" + "db/schema.prisma" ], - "91ec1889f649b608ca81cab8f048538b9dcc70f49444430b1e5b572af2a4970a" + "04fc93ff1cab3acf930dcea948ff60002d7da42f3deaf893b30b686f113490cc" ], [ [ "file", - "web-app/src/config.js" + "server/.env" ], - "b06175129dd8be8ca6c307fafa02646d47233c4e26fdfeea6d7802d02e9513f3" + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ], [ [ "file", - "web-app/src/entities/index.ts" + "server/.gitignore" ], - "52d61b8ed11976d75b351d2b7227469697781fbf8996b5b98143e220ada383f9" + "2c3d81dd719ff91d51609a02d03ba62ad456e2c50763b7b4c761395cb583f890" ], [ [ "file", - "web-app/src/ext-src/Main.css" + "server/.npmrc" ], - "1583ce49887ea575e563dab0c7ad6d2e2e3e6a351ed7c2f80c310641b1456417" + "8a74b1091affea3c71c2cf04acbaa38c4a51a261a9a98dcc9e96473d07a85a27" ], [ [ "file", - "web-app/src/ext-src/MainPage.jsx" + "server/README.md" ], - "8ee7fe1352719facadf0935eb45df8661ba13015277ea80be5a9200c66a31bde" + "e14514b8b152dd2160a217d8fc66a710c8607c4ed1441a2148a0770701818249" ], [ [ "file", - "web-app/src/ext-src/vite-env.d.ts" + "server/nodemon.json" ], - "d677883c270ee71acc9bfd95c824650b541036599427a8ffc0ad33323d08e61d" + "6cb3f8539e5cf59e29e3c97c9b4fa405600ea132784e4f47f79555951f47bd38" ], [ [ "file", - "web-app/src/ext-src/vite.config.ts" + "server/package.json" ], - "797dfb8022557b5ce5ce856daca01911974497f9ccf656f5920e5b42a986f4f8" + "40898402c8a6ca25f91c17f884e7401bd7e53710da91a8399f2e2c722c273c3b" ], [ [ "file", - "web-app/src/ext-src/waspLogo.png" + "server/rollup.config.js" ], - "0f05a89eb945d6d7326110e88776e402833b356202b06d0a8bf652e118d3fd2f" + "c1beb8264f11898364288d73b16f08d1923bac5f70038d9827978deb5b58a2da" ], [ [ "file", - "web-app/src/index.tsx" + "server/scripts/validate-env.mjs" ], - "d10c443130afd9848fcfa631424590784e70dc1c66a8b7a9a8c1dfa9dd7ad5df" + "65168a764fc6cbe785ee40a8e8533b4694ef9019fc5a73f60f7252152330d0a2" ], [ [ "file", - "web-app/src/logo.png" + "server/src/actions/types.ts" ], - "35f14abf46cb0e9d9b4e3d11961917eecb86be65a0d7f4e6bc9713c5766b5f1b" + "cc03111599e32695d677e8ac4e65b98cf90e0cb066e71c3da06af254c784b489" ], [ [ "file", - "web-app/src/operations/index.ts" + "server/src/app.js" ], - "7ec3870a9313ec17d2282f9002da4a5d4da3c096c5fb0927acd008f1bec60bb3" + "a10bb6f3daab886b0685994368711fd7718a2a3e50a9329cd7da6394b9c59302" ], [ [ "file", - "web-app/src/operations/resources.js" + "server/src/middleware/globalMiddleware.ts" ], - "c08445d84f9931ebc3e4f975017bf88c03b6bee9aa588e945d52fe3aee9c4d70" + "312850493f4b17b42d5878b1c41be7db66e11bf5cf1997f9506cb06ee05ab5bd" ], [ [ "file", - "web-app/src/operations/updateHandlersMap.js" + "server/src/middleware/index.ts" ], - "07a9933a771853585fd2fc49c3dcb9f1cad947acb2168580c835fae25620fa9f" + "e658719309f9375f389c5d8d416fc27f9c247049e61188b3e01df954bcec15a4" ], [ [ "file", - "web-app/src/queries/core.d.ts" + "server/src/middleware/operations.ts" ], - "8ac475ed46a373ddc47e37dd557315c9c15abcde527749bb40c08527130e0567" + "23efbb9c408f8c12bdb77359a48177430b7da636163562d0105560891ac225b9" ], [ [ "file", - "web-app/src/queries/core.js" + "server/src/polyfill.ts" ], - "3ac4a8402a7d6af3eb4a90ec59bcfdd32585f3f2dc6d6bed8a1140cea8fdb7f2" + "66d3dca514bdd01be402714d0dfe3836e76f612346dea57ee595ae4f3da915cf" ], [ [ "file", - "web-app/src/queries/index.d.ts" + "server/src/queries/types.ts" ], - "f3a7cf037867cd7f8ce76cbca5e5eb2aacb9ca69933c182bce2f7ff935c4d385" + "19f72a3a37efd1e29b0793caa7f379494ad236bb513c8c8804b5a8d305c45196" ], [ [ "file", - "web-app/src/queries/index.js" + "server/src/routes/index.js" ], - "8379699fa710f43d5be2b96f3a5c7c551a8d3d9db3ef0fea964502da00f36ffc" + "c34f77a96150414957386f5645c9becb12725c9f231aaaa8db798e3564bd75ce" ], [ [ "file", - "web-app/src/queryClient.js" + "server/src/routes/operations/index.js" ], - "1739d8618286b4a2aa536bd3fcb754514c828ec896b69c7074e22f66c07e7b03" + "d09f7dcf78ed2da15f488afb08e62d9dac15f173fdbe779323dfdd75330f5de5" ], [ [ "file", - "web-app/src/router.tsx" + "server/src/server.ts" ], - "067478c4990bbe966fa1984cd9db91aba9aaa68196c5858eab787eb376ab48b9" + "ab9d7722a512f2a51a81a63de0b81172421dc86a6556c49f70aab4683d57657f" ], [ [ "file", - "web-app/src/router/Link.tsx" + "server/tsconfig.json" ], - "7b6214295d59d8dffbd61b82f9dab2b080b2d7ebe98cc7d9f9e8c229f99a890d" + "ae9b0031fd08188a5fa7ab0a0994dfe9bdbd1d8f2e1ba2df4f609b9b470eb6b4" ], [ [ "file", - "web-app/src/router/linkHelpers.ts" + "web-app/.env" ], - "c296ed5e7924ad1173f4f0fb4dcce053cffd5812612069b5f62d1bf9e96495cf" + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ], [ [ "file", - "web-app/src/router/types.ts" + "web-app/.gitignore" ], - "7f08b262987c17f953c4b95814631a7aaac82eb77660bcb247ef7bf866846fe1" + "d373417ea2a8844e3b7a1515aab123e90fbeb4b7225144d55d243d9f6f04f73a" ], [ [ "file", - "web-app/src/storage.ts" + "web-app/.npmrc" ], - "e9e2a4a02d48bea1597fcdc00592e3d975eea7fa6e0545cf087da9429c5f4979" + "7151cf397def0c2cb0ab65643701d27d335a72c90f775675b5f826bc7005818a" ], [ [ "file", - "web-app/src/test/index.ts" + "web-app/README.md" ], - "cb2e2dc33df8afc0d4453f4322a4e2af92f3345e9622e0416fa87e34d6acb9d8" + "6af47b8c26fa9d30e9b774e6c38d3456a3b469c3101bffb186e2a1fb325a93f4" ], [ [ "file", - "web-app/src/test/vitest/helpers.tsx" + "web-app/index.html" ], - "a38e55c9999a87ab497538bcad7c880f32a4d27f2227ae326cb76eb0848b89e9" + "f38792224e7db1569c41ec117a2cb211dec4620b8b4302c47ff7fc8f58ce3647" ], [ [ "file", - "web-app/src/test/vitest/setup.ts" + "web-app/netlify.toml" ], - "1c08b10e428cec3939e0ab269c9a02694e196de7c5dd9f18372424bdccbc5028" + "854009c7d1b2630a55099439f89e4947188ea4160c9d1388b46b5a5cf6ab461a" ], [ [ "file", - "web-app/src/types.ts" + "web-app/package.json" ], - "282f6bdef1e7e8846ad53909bbf88c54cd04a0594b77b1e87cb69266de84cc6d" + "58b50932dadb8d0eadd20132f39dc1871eb9dfc026978fe7db217be58eb73a51" ], [ [ "file", - "web-app/src/universal/types.ts" + "web-app/public/.gitkeep" ], - "8ef378c1447289104856ec1a92931fd1280c0f8d0a8463008674e93bd798b884" + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ], [ [ "file", - "web-app/src/universal/url.ts" + "web-app/public/favicon.ico" ], - "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" + "1481f03584b46b63182c1f8d26e61a95ce4d8fae032b2b4f3fe5e00ab7e96c23" + ], + [ + [ + "file", + "web-app/public/manifest.json" + ], + "434b67f4ee148d6a5c8d88879b616d0af36d71abf193e84ef247e5ab959a13bd" + ], + [ + [ + "file", + "web-app/scripts/validate-env.mjs" + ], + "a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd" + ], + [ + [ + "file", + "web-app/src/entities/index.ts" + ], + "52d61b8ed11976d75b351d2b7227469697781fbf8996b5b98143e220ada383f9" + ], + [ + [ + "file", + "web-app/src/index.tsx" + ], + "ff83778b7f03a8f15116bc73adce607c2c13fc9cbd4228626980a530541aaeb2" + ], + [ + [ + "file", + "web-app/src/logo.png" + ], + "35f14abf46cb0e9d9b4e3d11961917eecb86be65a0d7f4e6bc9713c5766b5f1b" + ], + [ + [ + "file", + "web-app/src/queryClient.js" + ], + "1739d8618286b4a2aa536bd3fcb754514c828ec896b69c7074e22f66c07e7b03" + ], + [ + [ + "file", + "web-app/src/router.tsx" + ], + "aaa46223db86cf8a7af9c2fe89d50345e0d9b3fa2587e91f4680810d032db452" + ], + [ + [ + "file", + "web-app/src/test/vitest/setup.ts" + ], + "610e936776aaa39e861f0b2a83b0c0290d74ca8123d9d5409e5f2183384fdb52" ], [ [ @@ -571,7 +648,7 @@ "file", "web-app/tsconfig.json" ], - "f1b31ca75b2b32c5b0441aec4fcd7f285c18346761ba1640761d6253d65e3580" + "dfeee6d883ed2504c149c64b24ca939c0ad4812b78bfdced7293a386a008effd" ], [ [ @@ -585,6 +662,6 @@ "file", "web-app/vite.config.ts" ], - "08962d79f2d71eb470ee85dee03db6deca7ede28df9d41542bbaea752db0eeed" + "64256d93d81f6192f419e836ed4484f0e8c1e28f018bfb3213851608200594ac" ] ] \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/Dockerfile b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/Dockerfile index 57a8aea124..ffc14b90bf 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/Dockerfile +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/Dockerfile @@ -2,7 +2,7 @@ # Because if not, we had situations where it would use the different version # locally and on Github CI. This way we ensure exact version is used, # and also have control over updating it (instead of update surprising us). -FROM node:18-alpine3.17 AS node +FROM node:18.18.0-alpine3.17 AS node # We split Dockerfile into base, server-builder and server-production. @@ -17,14 +17,27 @@ FROM node AS base RUN apk --no-cache -U upgrade # To ensure any potential security patches are applied. +# Todo: The 'server-builder' image stays on disk under : and is +# relatively large (~900 MB), should we remove it? Or is it useful for future +# builds? FROM base AS server-builder -RUN apk add --no-cache build-base libtool autoconf automake +# Building the Docker image on Apple's Silicon Mac fails without python3 (the build +# throws `node-gyp` errors when it tries to compile native deps. Installing +# `python3` fixes the issue. +RUN apk add --no-cache python3 build-base libtool autoconf automake WORKDIR /app -COPY server/ ./server/ +# Since the framwork code in /.wasp/build/server imports the user code in /src +# using relative imports, we must mirror the same directory structure in the +# Docker image. +COPY src ./src +COPY package.json . +COPY package-lock.json . +COPY .wasp/build/server .wasp/build/server +COPY .wasp/out/sdk .wasp/out/sdk # Install npm packages, resulting in node_modules/. -RUN cd server && npm install +RUN npm install && cd .wasp/build/server && npm install # Building the server should come after Prisma generation. -RUN cd server && npm run build +RUN cd .wasp/build/server && npm run bundle # TODO: Use pm2? @@ -34,13 +47,21 @@ FROM base AS server-production RUN apk add --no-cache python3 ENV NODE_ENV production WORKDIR /app -COPY --from=server-builder /app/server/node_modules ./server/node_modules -COPY --from=server-builder /app/server/dist ./server/dist -COPY --from=server-builder /app/server/package*.json ./server/ -COPY --from=server-builder /app/server/scripts ./server/scripts -COPY db/ ./db/ +# Copying the top level 'node_modules' because it contains the Prisma packages +# necessary for migrating the database. +COPY --from=server-builder /app/node_modules ./node_modules +# Copying the SDK because 'validate-env.mjs' executes independent of the bundle +# and references the 'wasp' package. +COPY --from=server-builder /app/.wasp/out/sdk .wasp/out/sdk +# Copying 'server/node_modules' because 'validate-env.mjs' executes independent +# of the bundle and references the dotenv package. +COPY --from=server-builder /app/.wasp/build/server/node_modules .wasp/build/server/node_modules +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/ EXPOSE ${PORT} -WORKDIR /app/server +WORKDIR /app/.wasp/build/server ENTRYPOINT ["npm", "run", "start-production"] diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/db/schema.prisma b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/db/schema.prisma index ae18b07ca9..b6d894bcd0 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/db/schema.prisma +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/db/schema.prisma @@ -6,6 +6,5 @@ datasource db { generator client { provider = "prisma-client-js" - output = env("PRISMA_CLIENT_OUTPUT_DIR") } diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/installedFullStackNpmDependencies.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/installedFullStackNpmDependencies.json deleted file mode 100644 index 7f7d12ca30..0000000000 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/installedFullStackNpmDependencies.json +++ /dev/null @@ -1 +0,0 @@ -{"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"express","version":"~4.18.1"},{"name":"morgan","version":"~1.10.0"},{"name":"@prisma/client","version":"4.16.2"},{"name":"jsonwebtoken","version":"^8.5.1"},{"name":"secure-password","version":"^4.0.0"},{"name":"dotenv","version":"16.0.2"},{"name":"helmet","version":"^6.0.0"},{"name":"patch-package","version":"^6.4.7"},{"name":"uuid","version":"^9.0.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"nodemon","version":"^2.0.19"},{"name":"standard","version":"^17.0.0"},{"name":"prisma","version":"4.16.2"},{"name":"typescript","version":"^5.1.0"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/uuid","version":"^9.0.0"},{"name":"@types/cors","version":"^2.8.5"}]},"npmDepsForWebApp":{"dependencies":[{"name":"axios","version":"^1.4.0"},{"name":"react","version":"^18.2.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"@prisma/client","version":"4.16.2"},{"name":"superjson","version":"^1.12.2"},{"name":"mitt","version":"3.0.0"},{"name":"react-hook-form","version":"^7.45.4"}],"devDependencies":[{"name":"vite","version":"^4.3.9"},{"name":"typescript","version":"^5.1.0"},{"name":"@types/react","version":"^18.0.37"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react-swc","version":"^3.0.0"},{"name":"dotenv","version":"^16.0.3"},{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"vitest","version":"^0.29.3"},{"name":"@vitest/ui","version":"^0.29.3"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.0.0"},{"name":"@testing-library/jest-dom","version":"^5.16.5"},{"name":"msw","version":"^1.1.0"}]}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/installedNpmDepsLog.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/installedNpmDepsLog.json new file mode 100644 index 0000000000..a010ca4b88 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/installedNpmDepsLog.json @@ -0,0 +1 @@ +{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"4.16.2"},{"name":"prisma","version":"4.16.2"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"jsonwebtoken","version":"^8.5.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"secure-password","version":"^4.0.0"},{"name":"sodium-native","version":"3.3.0"},{"name":"superjson","version":"^1.12.2"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"4.16.2"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"jsonwebtoken","version":"^8.5.1"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"secure-password","version":"^4.0.0"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/api/events.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/api/events.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/api/events.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/api/events.ts diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/api.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/api/index.ts similarity index 92% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/api.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/api/index.ts index 17e36c1248..d066bd5448 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/api.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/api/index.ts @@ -1,10 +1,11 @@ import axios, { type AxiosError } from 'axios' -import config from './config' -import { storage } from './storage' -import { apiEventsEmitter } from './api/events' +import config from 'wasp/core/config' +import { storage } from 'wasp/core/storage' +import { apiEventsEmitter } from './events.js' -const api = axios.create({ +// PUBLIC API +export const api = axios.create({ baseURL: config.apiUrl, }) @@ -12,22 +13,26 @@ 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() @@ -66,6 +71,7 @@ window.addEventListener('storage', (event) => { } }) +// 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 @@ -100,5 +106,3 @@ class WaspHttpError extends Error { this.data = data } } - -export default api diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/types.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/index.ts similarity index 89% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/types.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/index.ts index 982b766e37..1972713940 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/types.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/index.ts @@ -1,3 +1,4 @@ +// PUBLIC API // NOTE: This is enough to cover Operations and our APIs (src/Wasp/AppSpec/Api.hs). export enum HttpMethod { Get = 'GET', @@ -6,4 +7,5 @@ export enum HttpMethod { Delete = 'DELETE', } +// PUBLIC API export type Route = { method: HttpMethod; path: string } diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/actions/core.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts similarity index 73% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/actions/core.d.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts index fa31f329ff..894c01f91c 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/actions/core.d.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts @@ -1,6 +1,7 @@ -import { type Action } from '.' -import type { Expand, _Awaited, _ReturnType } from '../universal/types' +import { type Action } from '../core.js' +import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types' +// PRIVATE API export function createAction( actionRoute: string, entitiesUsed: unknown[] diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/actions/core.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/actions/core.js similarity index 90% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/actions/core.js rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/actions/core.js index 440e906140..17dd6aba4d 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/actions/core.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/actions/core.js @@ -1,9 +1,10 @@ -import { callOperation, makeOperationRoute } from '../operations' +import { callOperation, makeOperationRoute } from '../internal/index.js' import { registerActionInProgress, registerActionDone, -} from '../operations/resources' +} from '../internal/resources.js' +// PRIVATE API export function createAction(relativeActionRoute, entitiesUsed) { const actionRoute = makeOperationRoute(relativeActionRoute) @@ -22,7 +23,7 @@ export function createAction(relativeActionRoute, entitiesUsed) { // 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 + // 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 diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/actions/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/actions/index.ts new file mode 100644 index 0000000000..32207e1a69 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/actions/index.ts @@ -0,0 +1 @@ +import { createAction } from './core' diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/actions/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/core.ts similarity index 64% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/actions/index.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/core.ts index 7fb2de2f9e..282c4698a7 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/actions/index.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/core.ts @@ -4,48 +4,95 @@ import { useMutation, UseMutationOptions, useQueryClient, -} from '@tanstack/react-query' -import { type Query } from '../queries'; + useQuery as rqUseQuery, + UseQueryResult, +} from "@tanstack/react-query"; +export { configureQueryClient } from "./queryClient"; -export type Action = - [Input] extends [never] ? - (args?: unknown) => Promise : - (args: Input) => Promise +// 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[] -} + optimisticUpdates: OptimisticUpdateDefinition[]; +}; +// PUBLIC API /** * A documented (public) way to define optimistic updates. */ export type OptimisticUpdateDefinition = { - getQuerySpecifier: GetQuerySpecifier - updateQuery: UpdateQuery -} + 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 +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 +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/data-model/operations/actions#the-useaction-hook-and-optimistic-updates + * https://wasp-lang.dev/docs/language/features#the-useaction-hook. */ -export type QuerySpecifier = [Query, ...any[]] +export type QuerySpecifier = [Query, ...any[]]; +// PUBLIC API /** * A hook for adding extra behavior to a Wasp Action (e.g., optimistic updates). * @@ -59,12 +106,20 @@ export function useAction( ): typeof actionFn { const queryClient = useQueryClient(); - let mutationFn = actionFn - let options = {} + let mutationFn = actionFn; + let options = {}; if (actionOptions?.optimisticUpdates) { - const optimisticUpdatesDefinitions = actionOptions.optimisticUpdates.map(translateToInternalDefinition) - mutationFn = makeOptimisticUpdateMutationFn(actionFn, optimisticUpdatesDefinitions) - options = makeRqOptimisticUpdateOptions(queryClient, optimisticUpdatesDefinitions) + 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., @@ -74,25 +129,24 @@ export function useAction( // 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) + 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, + 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 +type SpecificUpdateQuery = (oldData: CachedData) => CachedData; /** * A specific, "instantiated" optimistic update definition which contains a @@ -101,64 +155,73 @@ type SpecificUpdateQuery = (oldData: CachedData) => CachedData type SpecificOptimisticUpdateDefinition = { queryKey: QueryKey; updateQuery: SpecificUpdateQuery; -} +}; type InternalAction = Action & { internal( item: Input, optimisticUpdateDefinitions: SpecificOptimisticUpdateDefinition[] - ): Promise -} + ): 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/data-model/operations/actions#the-useaction-hook-and-optimistic-updates + * 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 { getQuerySpecifier, updateQuery } = publicOptimisticUpdateDefinition; - const definitionErrors = [] - if (typeof getQuerySpecifier !== 'function') { - definitionErrors.push('`getQuerySpecifier` is not a function.') + 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 (typeof updateQuery !== "function") { + definitionErrors.push("`updateQuery` is not a function."); } if (definitionErrors.length) { - throw new TypeError(`Invalid optimistic update definition: ${definitionErrors.join(', ')}.`) + 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[] + 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) - } + (generalDefinition) => + getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item) + ); + return (actionFn as InternalAction).internal( + item, + specificOptimisticUpdateDefinitions + ); + }; } /** @@ -168,7 +231,7 @@ function makeOptimisticUpdateMutationFn( * 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 @@ -179,40 +242,49 @@ function makeOptimisticUpdateMutationFn( */ function makeRqOptimisticUpdateOptions( queryClient: QueryClient, - optimisticUpdateDefinitions: InternalOptimisticUpdateDefinition[] + optimisticUpdateDefinitions: InternalOptimisticUpdateDefinition< + ActionInput, + CachedData + >[] ): Pick { async function onMutate(item) { const specificOptimisticUpdateDefinitions = optimisticUpdateDefinitions.map( - generalDefinition => getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item) - ) + (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) - )) + 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() + const previousData = new Map(); specificOptimisticUpdateDefinitions.forEach(({ queryKey, updateQuery }) => { // Snapshot the currently cached value. - const previousDataForQuery: CachedData = queryClient.getQueryData(queryKey) + const previousDataForQuery: CachedData = + queryClient.getQueryData(queryKey); // Attempt to optimistically update the cache using the new value. try { - queryClient.setQueryData(queryKey, updateQuery) + queryClient.setQueryData(queryKey, updateQuery); } catch (e) { - console.error("The `updateQuery` function threw an exception, skipping optimistic update:") - console.error(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) - }) + previousData.set(queryKey, previousDataForQuery); + }); - return { previousData } + return { previousData }; } function onError(_err, _item, context) { @@ -222,15 +294,15 @@ function makeRqOptimisticUpdateOptions( // 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) - }) + await queryClient.cancelQueries(queryKey); + queryClient.setQueryData(queryKey, data); + }); } return { onMutate, onError, - } + }; } /** @@ -246,24 +318,29 @@ function makeRqOptimisticUpdateOptions( * provided definition and closes over the provided item. */ function getOptimisticUpdateDefinitionForSpecificItem( - optimisticUpdateDefinition: InternalOptimisticUpdateDefinition, + optimisticUpdateDefinition: InternalOptimisticUpdateDefinition< + ActionInput, + CachedData + >, item: ActionInput ): SpecificOptimisticUpdateDefinition { - const { getQueryKey, updateQuery } = optimisticUpdateDefinition + const { getQueryKey, updateQuery } = optimisticUpdateDefinition; return { queryKey: getQueryKey(item), - updateQuery: (old) => updateQuery(item, old) - } + 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/data-model/operations/actions#the-useaction-hook-and-optimistic-updates + * 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] +function getRqQueryKeyFromSpecifier( + querySpecifier: QuerySpecifier +): QueryKey { + const [queryFn, ...otherKeys] = querySpecifier; + return [...(queryFn as any).queryCacheKey, ...otherKeys]; } diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/index.ts new file mode 100644 index 0000000000..ec9ca9f689 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/web-app/src/operations/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/internal/index.ts similarity index 81% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/operations/index.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/internal/index.ts index 2d4494b050..c274b5aa76 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/operations/index.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/internal/index.ts @@ -1,12 +1,14 @@ -import api, { handleApiError } from '../api' -import { HttpMethod } from '../types' -import { +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) @@ -17,6 +19,7 @@ export async function callOperation(operationRoute: OperationRoute & { method: H } } +// PRIVATE API export function makeOperationRoute(relativeOperationRoute: string): OperationRoute { return { method: HttpMethod.Post, path: `/${relativeOperationRoute}` } } diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/operations/resources.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/internal/resources.js similarity index 97% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/operations/resources.js rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/internal/resources.js index 779cd55a5f..470ef70b82 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/operations/resources.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/internal/resources.js @@ -1,4 +1,4 @@ -import { queryClientInitialized } from '../queryClient' +import { queryClientInitialized } from '../queryClient.js' import { makeUpdateHandlersMap } from './updateHandlersMap' import { hashQueryKey } from '@tanstack/react-query' @@ -8,6 +8,8 @@ import { hashQueryKey } from '@tanstack/react-query' 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. diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/operations/updateHandlersMap.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/internal/updateHandlersMap.js similarity index 100% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/operations/updateHandlersMap.js rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/internal/updateHandlersMap.js diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/queries/core.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts similarity index 63% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/queries/core.d.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts index e1bdbe4783..ff8ae4a3b9 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/queries/core.d.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts @@ -1,19 +1,21 @@ -import { type Query } from '.' -import { Route } from '../types'; -import type { Expand, _Awaited, _ReturnType } from '../universal/types' +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[]; - }, + relativeQueryPath: string + queryRoute: Route + entitiesUsed: string[] + } ): void type QueryFor = Expand< diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/queries/core.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/queries/core.js similarity index 69% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/queries/core.js rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/queries/core.js index 5103db1d8b..c4b3e5f2e4 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/queries/core.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/queries/core.js @@ -1,16 +1,17 @@ -import { callOperation, makeOperationRoute } from '../operations' +import { callOperation, makeOperationRoute } from '../internal/index.js' import { addResourcesUsedByQuery, getActiveOptimisticUpdates, -} from '../operations/resources' +} 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), + (result, update) => update(result), serverResult, ) } @@ -20,7 +21,11 @@ export function createQuery(relativeQueryPath, entitiesUsed) { return query } -export function addMetadataToQuery(query, { relativeQueryPath, queryRoute, entitiesUsed }) { +// 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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/queries/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/queries/index.ts new file mode 100644 index 0000000000..17f6f8e238 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/queryClient.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/queryClient.ts new file mode 100644 index 0000000000..c2d1cb86df --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/web-app/src/router/Link.tsx b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/Link.tsx similarity index 91% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/router/Link.tsx rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/Link.tsx index df29edb857..2215ddc639 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/router/Link.tsx +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/Link.tsx @@ -1,10 +1,11 @@ import { useMemo } from 'react' import { Link as RouterLink } from 'react-router-dom' -import { type Routes } from '../router' import { interpolatePath } from './linkHelpers' +import { type Routes } from './index' type RouterLinkProps = Parameters[0] +// PUBLIC API export function Link( { to, params, search, hash, ...restOfProps }: Omit & { diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/index.ts new file mode 100644 index 0000000000..90f93b35f2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/web-app/src/router/linkHelpers.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/linkHelpers.ts similarity index 98% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/router/linkHelpers.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/linkHelpers.ts index 291d8238a3..e10cba9281 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/router/linkHelpers.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/linkHelpers.ts @@ -1,5 +1,6 @@ import type { Params, Search } from "./types"; +// PRIVATE API export function interpolatePath( path: string, params?: Params, diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/router/types.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/types.ts similarity index 91% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/router/types.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/types.ts index 0688d0bbba..ffaeb4fe01 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/router/types.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/router/types.ts @@ -1,13 +1,18 @@ +// 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 diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/test/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/test/index.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/test/index.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/test/index.ts diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/test/vitest/helpers.tsx b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/test/vitest/helpers.tsx similarity index 93% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/test/vitest/helpers.tsx rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/test/vitest/helpers.tsx index 4152191129..8ffbc9a7b4 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/test/vitest/helpers.tsx +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/test/vitest/helpers.tsx @@ -6,19 +6,20 @@ 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 '../../queries' -import config from '../../config' -import { HttpMethod, Route } from '../../types' - -export type { Route } from '../../types' +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 { @@ -39,6 +40,7 @@ export function renderInContext(ui: ReactElement): RenderResult { } } +// PUBLIC API export function mockServer(): { server: SetupServer mockQuery: MockQuery diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/config.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/core/config.ts similarity index 72% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/config.js rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/core/config.ts index c5d18dfed1..e9234e6f2a 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/config.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/core/config.ts @@ -1,4 +1,4 @@ -import { stripTrailingSlash } from "./universal/url"; +import { stripTrailingSlash } from 'wasp/universal/url' const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/storage.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/core/storage.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/storage.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/core/storage.ts diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dev/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dev/index.ts new file mode 100644 index 0000000000..e9bd93f7da --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/events.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/events.d.ts new file mode 100644 index 0000000000..c5f6b6e5da --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/events.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/events.js new file mode 100644 index 0000000000..b405507c51 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/events.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/events.js.map new file mode 100644 index 0000000000..de0637d22d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.d.ts new file mode 100644 index 0000000000..634416ecd5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.js new file mode 100644 index 0000000000..2015c488dc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.js.map new file mode 100644 index 0000000000..15be79e1ef --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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;CACvB,CAAC,CAAA;AAEF,MAAM,6BAA6B,GAAG,WAAW,CAAA;AAEjD,IAAI,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAuB,CAAA;AAE3F,oBAAoB;AACpB,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,oBAAoB,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,SAAS,CAAC,CAAA;IACrD,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;AACxC,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,YAAY;IAC1B,OAAO,oBAAoB,CAAA;AAC7B,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,cAAc;IAC5B,oBAAoB,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAA;IAC7C,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;AAC1C,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,mBAAmB;IACjC,oBAAoB,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,KAAK,EAAE,CAAA;IACf,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;AAC1C,CAAC;AAED,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;IACvC,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAChC,IAAI,SAAS,EAAE;QACb,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,SAAS,EAAE,CAAA;KACzD;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAC,CAAA;AAEF,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;;IACjD,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,MAAK,GAAG,EAAE;QAClC,cAAc,EAAE,CAAA;KACjB;IACD,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC,CAAC,CAAA;AAEF,kFAAkF;AAClF,2DAA2D;AAC3D,6EAA6E;AAC7E,0FAA0F;AAC1F,sFAAsF;AACtF,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;IAC3C,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,cAAc,CAAC,6BAA6B,CAAC,EAAE;QACvE,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE;YACpB,oBAAoB,GAAG,KAAK,CAAC,QAAQ,CAAA;YACrC,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;SACvC;aAAM;YACL,oBAAoB,GAAG,SAAS,CAAA;YAChC,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;SACzC;KACF;AACH,CAAC,CAAC,CAAA;AAEF,oBAAoB;AACpB;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAuD;;IACpF,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EAAE;QACnB,wEAAwE;QACxE,8CAA8C;QAC9C,8EAA8E;QAC9E,8BAA8B;QAC9B,yEAAyE;QACzE,iEAAiE;QACjE,iFAAiF;QACjF,MAAM,YAAY,GAAG,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,CAAA;QACzC,MAAM,kBAAkB,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAA;QAChD,MAAM,IAAI,aAAa,CAAC,kBAAkB,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,mCAAI,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;KAClG;SAAM;QACL,4CAA4C;QAC5C,MAAM,KAAK,CAAA;KACZ;AACH,CAAC;AAED,MAAM,aAAc,SAAQ,KAAK;IAK/B,YAAa,UAAkB,EAAE,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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.d.ts new file mode 100644 index 0000000000..fd6cf83b9e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.js new file mode 100644 index 0000000000..c13afdb0c7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.js.map new file mode 100644 index 0000000000..b7394b3505 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts new file mode 100644 index 0000000000..e2c6699d11 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js new file mode 100644 index 0000000000..51abcbe936 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map new file mode 100644 index 0000000000..5834336f1d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map new file mode 100644 index 0000000000..58e967cc07 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts new file mode 100644 index 0000000000..a23b24ebd6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/core.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/core.js new file mode 100644 index 0000000000..2c94cb01fd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/core.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/core.js.map new file mode 100644 index 0000000000..68ea114aa9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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,CAAC,GAAG,OAAO,CAAC,aAAa,EAAE,WAAW,CAAC;QACzC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC5B,OAAO,UAAU,iBACf,QAAQ,EACR,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,WAAW,CAAC,IAC1C,OAAO,EACV,CAAC;AACL,CAAC;AAmDD,aAAa;AACb;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CACvB,QAA+B,EAC/B,aAAoC;IAEpC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,IAAI,UAAU,GAAG,QAAQ,CAAC;IAC1B,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,iBAAiB,EAAE;QACpC,MAAM,4BAA4B,GAAG,aAAa,CAAC,iBAAiB,CAAC,GAAG,CACtE,6BAA6B,CAC9B,CAAC;QACF,UAAU,GAAG,8BAA8B,CACzC,QAAQ,EACR,4BAA4B,CAC7B,CAAC;QACF,OAAO,GAAG,6BAA6B,CACrC,WAAW,EACX,4BAA4B,CAC7B,CAAC;KACH;IAED,wEAAwE;IACxE,2EAA2E;IAC3E,wEAAwE;IACxE,4EAA4E;IAC5E,4EAA4E;IAC5E,sEAAsE;IACtE,0CAA0C;IAC1C,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAC9C,CAAC;AAiCD;;;;;;;;GAQG;AACH,SAAS,6BAA6B,CACpC,gCAA8E;IAE9E,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,GAAG,gCAAgC,CAAC;IAE5E,MAAM,gBAAgB,GAAG,EAAE,CAAC;IAC5B,IAAI,OAAO,iBAAiB,KAAK,UAAU,EAAE;QAC3C,gBAAgB,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;KACjE;IACD,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;QACrC,gBAAgB,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;KAC3D;IACD,IAAI,gBAAgB,CAAC,MAAM,EAAE;QAC3B,MAAM,IAAI,SAAS,CACjB,yCAAyC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACxE,CAAC;KACH;IAED,OAAO;QACL,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,0BAA0B,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC1E,WAAW;KACZ,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,8BAA8B,CACrC,QAA+B,EAC/B,2BAGG;IAEH,OAAO,SAAS,kCAAkC,CAAC,IAAI;QACrD,MAAM,mCAAmC,GAAG,2BAA2B,CAAC,GAAG,CACzE,CAAC,iBAAiB,EAAE,EAAE,CACpB,4CAA4C,CAAC,iBAAiB,EAAE,IAAI,CAAC,CACxE,CAAC;QACF,OAAQ,QAA0C,CAAC,QAAQ,CACzD,IAAI,EACJ,mCAAmC,CACpC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAS,6BAA6B,CACpC,WAAwB,EACxB,2BAGG;IAEH,KAAK,UAAU,QAAQ,CAAC,IAAI;QAC1B,MAAM,mCAAmC,GAAG,2BAA2B,CAAC,GAAG,CACzE,CAAC,iBAAiB,EAAE,EAAE,CACpB,4CAA4C,CAAC,iBAAiB,EAAE,IAAI,CAAC,CACxE,CAAC;QAEF,iFAAiF;QACjF,iEAAiE;QACjE,4EAA4E;QAC5E,mFAAmF;QACnF,MAAM,OAAO,CAAC,GAAG,CACf,mCAAmC,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CACvD,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,CACpC,CACF,CAAC;QAEF,4EAA4E;QAC5E,MAAM,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,mCAAmC,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE;YACxE,uCAAuC;YACvC,MAAM,oBAAoB,GACxB,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YAErC,kEAAkE;YAClE,IAAI;gBACF,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;aACjD;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,KAAK,CACX,4EAA4E,CAC7E,CAAC;gBACF,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aAClB;YAED,iEAAiE;YACjE,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,YAAY,EAAE,CAAC;IAC1B,CAAC;IAED,SAAS,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO;QACnC,+EAA+E;QAC/E,8EAA8E;QAC9E,8EAA8E;QAC9E,+EAA+E;QAC/E,YAAY;QACZ,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;YACpD,MAAM,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAC1C,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,QAAQ;QACR,OAAO;KACR,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,4CAA4C,CACnD,0BAGC,EACD,IAAiB;IAEjB,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,0BAA0B,CAAC;IAChE,OAAO;QACL,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC;QAC3B,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts new file mode 100644 index 0000000000..301165fa8e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/index.js new file mode 100644 index 0000000000..f83307c7b1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/index.js.map new file mode 100644 index 0000000000..982c957a9a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts new file mode 100644 index 0000000000..e31c8b5a4b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js new file mode 100644 index 0000000000..68bbdadf3d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map new file mode 100644 index 0000000000..a4097ef8cb --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts new file mode 100644 index 0000000000..6f51eab82e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js new file mode 100644 index 0000000000..86ab763337 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map new file mode 100644 index 0000000000..c91fecd3c7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;KAC7B;AACH,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,sBAAsB;IAC7D,sBAAsB,CAAC,OAAO,CAC5B,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CACzE,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,SAAS,EAAE,sBAAsB;IACxE,sBAAsB,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAA;IACjF,MAAM,sBAAsB,CAAC,SAAS,CAAC,CAAA;AACzC,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,QAAQ;IACjD,OAAO,cAAc,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAA;AACnD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B;IAC9C,MAAM,WAAW,GAAG,MAAM,sBAAsB,CAAA;IAChD,wEAAwE;IACxE,8EAA8E;IAC9E,eAAe;IACf,iFAAiF;IACjF,6EAA6E;IAC7E,wFAAwF;IACxF,kFAAkF;IAClF,WAAW,CAAC,YAAY,EAAE,CAAA;IAC1B,6EAA6E;IAC7E,2DAA2D;IAC3D,WAAW,CAAC,aAAa,EAAE,CAAA;AAC7B,CAAC;AAED;;;GAGG;AACH,KAAK,UAAU,sBAAsB,CAAC,SAAS;IAC7C,MAAM,WAAW,GAAG,MAAM,sBAAsB,CAAA;IAEhD,MAAM,0BAA0B,GAAG,wBAAwB,CAAC,SAAS,CAAC,CAAA;IACtE,0BAA0B,CAAC,OAAO,CAChC,aAAa,CAAC,EAAE,CAAC,WAAW,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAC9D,CAAA;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,uBAAuB,CAAC,QAAQ;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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts new file mode 100644 index 0000000000..715b6d06a1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js new file mode 100644 index 0000000000..34f590b5d2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map new file mode 100644 index 0000000000..7940fcd972 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts new file mode 100644 index 0000000000..cf16c63f44 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js new file mode 100644 index 0000000000..13b2cdcc9b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map new file mode 100644 index 0000000000..f8ad3284bd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts new file mode 100644 index 0000000000..575c502be1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts @@ -0,0 +1 @@ +export { addMetadataToQuery } from './core'; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js new file mode 100644 index 0000000000..1c28e8d0d3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map new file mode 100644 index 0000000000..5c83611fa3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts new file mode 100644 index 0000000000..40df1fa863 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js new file mode 100644 index 0000000000..9dfeab443f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map new file mode 100644 index 0000000000..82e2b19139 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts new file mode 100644 index 0000000000..fe53898b9f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/Link.jsx b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/Link.jsx new file mode 100644 index 0000000000..d38b7a9c65 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map new file mode 100644 index 0000000000..bb738bdad9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/index.d.ts new file mode 100644 index 0000000000..067b2fbd72 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/index.js new file mode 100644 index 0000000000..1a84b8d043 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/index.js.map new file mode 100644 index 0000000000..35eeff35e4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts new file mode 100644 index 0000000000..22fd81ec79 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js new file mode 100644 index 0000000000..144c9efc7c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map new file mode 100644 index 0000000000..064bcce597 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/types.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/types.d.ts new file mode 100644 index 0000000000..80d69a3452 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/types.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/types.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/router/types.js.map new file mode 100644 index 0000000000..7d60d60505 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/index.d.ts new file mode 100644 index 0000000000..b684c869ea --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/index.js new file mode 100644 index 0000000000..be0d1c7d5a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/index.js.map new file mode 100644 index 0000000000..33c10677b9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts new file mode 100644 index 0000000000..645112861a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx new file mode 100644 index 0000000000..fcc9fc0b7a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map new file mode 100644 index 0000000000..de41e60937 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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,CAAA;AAC3D,OAAO,EAAE,IAAI,EAA2C,MAAM,KAAK,CAAA;AACnE,OAAO,EAAE,WAAW,EAAoB,MAAM,UAAU,CAAA;AACxD,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAgB,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEvD,OAAO,MAAM,MAAM,kBAAkB,CAAA;AACrC,OAAO,EAAE,UAAU,EAAS,MAAM,aAAa,CAAA;AAW/C,aAAa;AACb,+CAA+C;AAC/C,sIAAsI;AACtI,MAAM,UAAU,eAAe,CAAC,EAAgB;IAC9C,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAA;IAChC,MAAM,KAA0B,MAAM,CACpC,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAClC;MAAA,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CACtB;IAAA,EAAE,mBAAmB,CAAC,CACvB,EAJK,EAAE,QAAQ,OAIf,EAJoB,MAAM,cAArB,YAAuB,CAI5B,CAAA;IACD,uCACK,MAAM,KACT,QAAQ,EAAE,CAAC,UAAwB,EAAE,EAAE,CACrC,QAAQ,CACN,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAClC;UAAA,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,EAAE,MAAM,CAC9B;QAAA,EAAE,mBAAmB,CAAC,CACvB,IACJ;AACH,CAAC;AAED,aAAa;AACb,MAAM,UAAU,UAAU;IAKxB,MAAM,MAAM,GAAgB,WAAW,EAAE,CAAA;IAEzC,SAAS,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;IAChC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,CAAC,aAAa,EAAE,CAAA;QACtB,OAAO,EAAE,CAAA;IACX,CAAC,CAAC,CAAA;IACF,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAA;IAE9B,MAAM,SAAS,GAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC/C,MAAM,KAAK,GAAI,KAAqC,CAAC,KAAK,CAAA;QAC1D,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAC1C,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC5C,CAAA;IACH,CAAC,CAAA;IAED,MAAM,OAAO,GAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC3C,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;IACvE,CAAC,CAAA;IAED,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAA;AACvC,CAAC;AAED,SAAS,SAAS,CAChB,MAAmB,EACnB,KAAY,EACZ,eAAwD;IAExD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;QACrD,MAAM,IAAI,KAAK,CACb,yCACE,KAAK,CAAC,MACR,mCAAmC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC3E,CAAA;KACF;IAED,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IAE3C,MAAM,QAAQ,GAAyD;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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/config.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/config.d.ts new file mode 100644 index 0000000000..b567b37b9a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/config.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/config.js new file mode 100644 index 0000000000..85d8f7e943 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/config.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/config.js.map new file mode 100644 index 0000000000..aa55beed81 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/storage.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/storage.d.ts new file mode 100644 index 0000000000..1beeea0400 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/storage.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/storage.js new file mode 100644 index 0000000000..e54cbb3c51 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/storage.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/core/storage.js.map new file mode 100644 index 0000000000..b7cd5db441 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/dev/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/dev/index.d.ts new file mode 100644 index 0000000000..14157874a1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/dev/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/dev/index.js new file mode 100644 index 0000000000..bd25589418 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/dev/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/dev/index.js.map new file mode 100644 index 0000000000..6874fe15b7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/entities/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/entities/index.d.ts new file mode 100644 index 0000000000..0af05cd188 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/entities/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/entities/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/entities/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/entities/index.js.map new file mode 100644 index 0000000000..28316c97d8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts new file mode 100644 index 0000000000..891990a1cc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx new file mode 100644 index 0000000000..1ecd86d313 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map new file mode 100644 index 0000000000..bc78a183b9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts new file mode 100644 index 0000000000..56b8d88eca --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js new file mode 100644 index 0000000000..3e216e57ce --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js.map new file mode 100644 index 0000000000..34064e924c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts new file mode 100644 index 0000000000..7f50bdcfce --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/index.js new file mode 100644 index 0000000000..814a00a31f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/index.js.map new file mode 100644 index 0000000000..692d12face --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts new file mode 100644 index 0000000000..8338115ad9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/serialization.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/serialization.js new file mode 100644 index 0000000000..085463a738 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map new file mode 100644 index 0000000000..4be6f7733a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts new file mode 100644 index 0000000000..5e88022f3e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts @@ -0,0 +1 @@ +export type _Entity = never; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js new file mode 100644 index 0000000000..bf72aeef47 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map new file mode 100644 index 0000000000..d716981499 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.d.ts new file mode 100644 index 0000000000..223bb1b22c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js new file mode 100644 index 0000000000..6de1c8d25f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js.map new file mode 100644 index 0000000000..4b121ba37d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts new file mode 100644 index 0000000000..396ea08918 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/dbClient.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/dbClient.js new file mode 100644 index 0000000000..a5d8ecd5d8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/dbClient.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/dbClient.js.map new file mode 100644 index 0000000000..677fd6e5d3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.d.ts new file mode 100644 index 0000000000..dee9613a53 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.js new file mode 100644 index 0000000000..0e53e0deab --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.js.map new file mode 100644 index 0000000000..b84ac1b303 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts new file mode 100644 index 0000000000..617cac8a78 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js new file mode 100644 index 0000000000..0926cba3d4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map new file mode 100644 index 0000000000..0490e6f7e3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts new file mode 100644 index 0000000000..4204eb294c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts @@ -0,0 +1 @@ +export * from './globalMiddleware.js'; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/index.js new file mode 100644 index 0000000000..db90d2875a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map new file mode 100644 index 0000000000..23374314b8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map new file mode 100644 index 0000000000..2735731598 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map new file mode 100644 index 0000000000..43367cc658 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts new file mode 100644 index 0000000000..ee6ed4259c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/index.js new file mode 100644 index 0000000000..dde0d8e4ae --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/index.js.map new file mode 100644 index 0000000000..3e4a082c05 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map new file mode 100644 index 0000000000..d36dc482c2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map new file mode 100644 index 0000000000..c4eb8778e7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/types/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/types/index.d.ts new file mode 100644 index 0000000000..ce2e8cb99c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/types/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/types/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/types/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/types/index.js.map new file mode 100644 index 0000000000..4ab1f1d596 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/utils.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/utils.d.ts new file mode 100644 index 0000000000..266b9c6fbb --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/utils.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/utils.js new file mode 100644 index 0000000000..9b2034006b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/utils.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/utils.js.map new file mode 100644 index 0000000000..f3af561141 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/types.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/types.d.ts new file mode 100644 index 0000000000..14dd465dca --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/types.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/types.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/types.js.map new file mode 100644 index 0000000000..8c06b33e94 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/url.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/url.d.ts new file mode 100644 index 0000000000..aa893e7838 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/url.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/url.js new file mode 100644 index 0000000000..988c0a67aa --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/url.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/url.js.map new file mode 100644 index 0000000000..a7bad96020 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/validators.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/validators.d.ts new file mode 100644 index 0000000000..bd179246a1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/server/scripts/universal/validators.mjs b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/validators.js similarity index 91% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/scripts/universal/validators.mjs rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/validators.js index 9e3605d3b5..53462b3932 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/scripts/universal/validators.mjs +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/validators.js @@ -9,13 +9,14 @@ export function isValidAbsoluteURL(rawUrl) { "localhost:" and host of "3000" */ return url.protocol === "http:" || url.protocol === "https:"; - } catch (e) { + } + 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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/validators.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/validators.js.map new file mode 100644 index 0000000000..313c98cef4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/server/src/entities/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/entities/index.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/entities/index.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/entities/index.ts diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/ext-src/Main.css b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/ext-src/Main.css similarity index 100% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/ext-src/Main.css rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/ext-src/Main.css diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/client/MainPage.jsx b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/ext-src/MainPage.jsx similarity index 81% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/client/MainPage.jsx rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/ext-src/MainPage.jsx index c53ad8abaa..01aae7c3db 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/client/MainPage.jsx +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/ext-src/MainPage.jsx @@ -1,7 +1,7 @@ -import waspLogo from './waspLogo.png' -import './Main.css' +import waspLogo from "./waspLogo.png"; +import "./Main.css"; -const MainPage = () => { +export function MainPage() { return (
@@ -9,7 +9,9 @@ const MainPage = () => { wasp
-

Welcome to Wasp - you just started a new app!

+

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

This is page MainPage located at route /. Open src/client/MainPage.jsx to edit it. @@ -35,6 +37,5 @@ const MainPage = () => { - ) + ); } -export default MainPage diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/ext-src/waspLogo.png b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/ext-src/waspLogo.png similarity index 100% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/ext-src/waspLogo.png rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/ext-src/waspLogo.png diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/package.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/package.json new file mode 100644 index 0000000000..5e4e77b7ce --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/package.json @@ -0,0 +1,101 @@ +{ + "dependencies": { + "@prisma/client": "4.16.2", + "@tanstack/react-query": "^4.29.0", + "@testing-library/jest-dom": "^6.3.0", + "@testing-library/react": "^14.1.2", + "@types/express-serve-static-core": "^4.17.13", + "@vitest/ui": "^1.2.1", + "axios": "^1.4.0", + "express": "~4.18.1", + "jsdom": "^21.1.1", + "jsonwebtoken": "^8.5.1", + "lodash.merge": "^4.6.2", + "mitt": "3.0.0", + "msw": "^1.1.0", + "prisma": "4.16.2", + "react": "^18.2.0", + "react-hook-form": "^7.45.4", + "react-router-dom": "^5.3.3", + "secure-password": "^4.0.0", + "sodium-native": "3.3.0", + "superjson": "^1.12.2", + "uuid": "^9.0.0", + "vitest": "^1.2.1" + }, + "devDependencies": { + "@tsconfig/node18": "latest" + }, + "exports": { + "./api/events": "./dist/api/events.js", + "./auth": "./dist/auth/index.js", + "./auth/helpers/user": "./dist/auth/helpers/user.js", + "./auth/jwt": "./dist/auth/jwt.js", + "./auth/pages/createAuthRequiredPage": "./dist/auth/pages/createAuthRequiredPage.jsx", + "./auth/password": "./dist/auth/password.js", + "./auth/providers/types": "./dist/auth/providers/types.js", + "./auth/session": "./dist/auth/session.js", + "./auth/utils": "./dist/auth/utils.js", + "./auth/validation": "./dist/auth/validation.js", + "./client": "./dist/client/index.js", + "./client/api": "./dist/api/index.js", + "./client/auth": "./dist/client/auth/index.js", + "./client/crud": "./dist/client/crud/index.js", + "./client/operations": "./dist/client/operations/index.js", + "./client/router": "./dist/client/router/index.js", + "./client/test": "./dist/client/test/index.js", + "./client/test/*": "./dist/client/test/*.js", + "./client/webSocket": "./dist/client/webSocket/index.js", + "./client/webSocket/WebSocketProvider": "./dist/client/webSocket/WebSocketProvider.jsx", + "./core/auth": "./dist/core/auth.js", + "./core/config": "./dist/core/config.js", + "./core/stitches.config": "./dist/core/stitches.config.js", + "./core/storage": "./dist/core/storage.js", + "./dev": "./dist/dev/index.js", + "./entities": "./dist/entities/index.js", + "./ext-src/*": "./dist/ext-src/*.js", + "./operations": "./dist/operations/index.js", + "./operations/*": "./dist/operations/*", + "./server": "./dist/server/index.js", + "./server/api": "./dist/server/api/index.js", + "./server/auth": "./dist/server/auth/index.js", + "./server/auth/email": "./dist/server/auth/email/index.js", + "./server/auth/email/utils": "./dist/server/auth/email/utils.js", + "./server/crud": "./dist/server/crud/index.js", + "./server/crud/*": "./dist/server/crud/*", + "./server/email": "./dist/server/email/index.js", + "./server/email/core/types": "./dist/server/email/core/types.js", + "./server/jobs": "./dist/server/jobs/index.js", + "./server/jobs/*": "./dist/server/jobs/*.js", + "./server/jobs/core/pgBoss": "./dist/server/jobs/core/pgBoss/index.js", + "./server/middleware": "./dist/server/middleware/index.js", + "./server/opeations/actions": "./dist/server/actions/index.js", + "./server/operations": "./dist/server/operations/index.js", + "./server/operations/queries": "./dist/server/queries/index.js", + "./server/types": "./dist/server/types/index.js", + "./server/utils": "./dist/server/utils.js", + "./server/webSocket": "./dist/server/webSocket/index.js", + "./universal/types": "./dist/universal/types.js", + "./universal/url": "./dist/universal/url.js", + "./universal/validators": "./dist/universal/validators.js" + }, + "include": [ + "src/**/*" + ], + "license": "ISC", + "name": "wasp", + "private": true, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "types": "tsc --declaration --emitDeclarationOnly --stripInternal --declarationDir dist" + }, + "type": "module", + "typesVersions": { + "*": { + "client/api": [ + "api/index.ts" + ] + } + }, + "version": "1.0.0" +} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/core/HttpError.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/HttpError.ts similarity index 67% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/core/HttpError.js rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/HttpError.ts index 8a2cb04db5..3e8d3f5a0d 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/core/HttpError.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/HttpError.ts @@ -1,5 +1,8 @@ -class HttpError extends Error { - constructor (statusCode, message, data, ...params) { +export class HttpError extends Error { + public statusCode: number + public data: unknown + + constructor (statusCode: number, message?: string, data?: Record, ...params: unknown[]) { super(message, ...params) if (Error.captureStackTrace) { @@ -18,5 +21,3 @@ class HttpError extends Error { } } } - -export default HttpError diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/_types/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/_types/index.ts similarity index 93% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/_types/index.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/_types/index.ts index 189810ac8d..137aa69a91 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/_types/index.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/_types/index.ts @@ -1,7 +1,7 @@ -import { type Expand } from "../universal/types.js"; +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 "../dbClient.js" +import { prisma } from 'wasp/server' import { type _Entity } from "./taggedEntities" import { type Payload } from "./serialization"; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/_types/serialization.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/_types/serialization.ts similarity index 95% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/_types/serialization.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/_types/serialization.ts index 595b5ba69f..c8ff9c1ae3 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/_types/serialization.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/_types/serialization.ts @@ -18,7 +18,7 @@ export interface JSONObject { type PrimitiveJSONValue = string | number | boolean | undefined | null -interface JSONArray extends Array {} +export interface JSONArray extends Array {} type SerializableJSONValue = | Symbol diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/_types/taggedEntities.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts similarity index 94% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/_types/taggedEntities.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts index 6d3985f027..61c6677ae3 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/_types/taggedEntities.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts @@ -6,7 +6,7 @@ import { type Entity, type EntityName, -} from '../entities' +} from 'wasp/entities' export type _Entity = diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/config.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/config.ts similarity index 59% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/config.js rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/config.ts index 35ba136633..07c90ee26b 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/config.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/config.ts @@ -1,6 +1,6 @@ import merge from 'lodash.merge' -import { stripTrailingSlash } from "./universal/url.js"; +import { stripTrailingSlash } from "wasp/universal/url"; const env = process.env.NODE_ENV || 'development' @@ -9,23 +9,44 @@ const env = process.env.NODE_ENV || 'development' // - Use convict library to define schema and validate env vars. // https://codingsans.com/blog/node-config-best-practices -const config = { +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, - frontendUrl: undefined, allowedCORSOrigins: [], }, development: getDevelopmentConfig(), production: getProductionConfig(), } -const resolvedConfig = merge(config.all, config[env]) +const resolvedConfig: Config = merge(config.all, config[env]) +// PUBLIC API export default resolvedConfig -function getDevelopmentConfig() { +function getDevelopmentConfig(): EnvConfig { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); return { frontendUrl, @@ -33,7 +54,7 @@ function getDevelopmentConfig() { } } -function getProductionConfig() { +function getProductionConfig(): EnvConfig { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); return { frontendUrl, diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/dbClient.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/dbClient.ts new file mode 100644 index 0000000000..0084433d03 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/index.ts new file mode 100644 index 0000000000..535077900b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts new file mode 100644 index 0000000000..8bab5e4709 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/middleware/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/middleware/index.ts new file mode 100644 index 0000000000..50996ec27d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/middleware/index.ts @@ -0,0 +1 @@ +export * from './globalMiddleware.js' diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/operations/actions/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/operations/actions/index.ts new file mode 100644 index 0000000000..78b2ff0a44 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/operations/actions/index.ts @@ -0,0 +1,2 @@ +import { prisma } from 'wasp/server' + diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/operations/actions/types.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/operations/actions/types.ts new file mode 100644 index 0000000000..183065b864 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/operations/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/operations/index.ts new file mode 100644 index 0000000000..5d50ecb37b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/operations/queries/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/operations/queries/index.ts new file mode 100644 index 0000000000..78b2ff0a44 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/operations/queries/index.ts @@ -0,0 +1,2 @@ +import { prisma } from 'wasp/server' + diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/operations/queries/types.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/operations/queries/types.ts new file mode 100644 index 0000000000..a156fb294a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/server/src/types/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/types/index.ts similarity index 73% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/types/index.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/types/index.ts index b30c92f5ec..1bbffc7555 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/types/index.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/types/index.ts @@ -1,14 +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, } - -export type { Application } from 'express' -export type { Server } from 'http' - diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/utils.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/utils.ts similarity index 52% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/utils.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/utils.ts index 99492c5474..c8cc823348 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/utils.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/utils.ts @@ -32,33 +32,3 @@ async (req: RequestWithExtraFields, res: Response, next: NextFunction) => { } export const sleep = (ms: number): Promise => new Promise((r) => setTimeout(r, ms)) - -export function getDirPathFromFileUrl(fileUrl: string): string { - return fileURLToPath(dirname(fileUrl)) -} - -export async function importJsFilesFromDir( - pathToDir: string, - whitelistedFileNames: string[] | null = null -): Promise { - return new Promise((resolve, reject) => { - readdir(pathToDir, async (err, files) => { - if (err) { - return reject(err) - } - const importPromises = files - .filter((file) => file.endsWith('.js') && isWhitelistedFileName(file)) - .map((file) => import(`${pathToDir}/${file}`)) - resolve(Promise.all(importPromises)) - }) - }) - - function isWhitelistedFileName(fileName: string) { - // No whitelist means all files are whitelisted - if (!Array.isArray(whitelistedFileNames)) { - return true - } - - return whitelistedFileNames.some((whitelistedFileName) => fileName === whitelistedFileName) - } -} diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/tsconfig.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/tsconfig.json new file mode 100644 index 0000000000..a7030c61d5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/web-app/src/universal/types.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/types.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/universal/types.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/types.ts diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/universal/url.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/url.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/universal/url.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/url.ts diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/validators.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/validators.ts new file mode 100644 index 0000000000..3d30d9622a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/nodemon.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/nodemon.json index 9ac8c1df77..01fe71701a 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/nodemon.json +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/nodemon.json @@ -4,7 +4,9 @@ }, "watch": [ "src/", + "../../../src/", ".env" ], + "comment-filip": "We now have to watch ../../../src/ because we're importing client files directly", "ext": "ts,mts,js,mjs,json" } diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/package.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/package.json index f2bd3cba5c..dd943c4429 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/package.json +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/package.json @@ -1,19 +1,16 @@ { + "comment-filip": "The server.js location changed because we have now included client source files above .wasp/out/server/src.", "dependencies": { - "@prisma/client": "4.16.2", "cookie-parser": "~1.4.6", "cors": "^2.8.5", "dotenv": "16.0.2", "express": "~4.18.1", "helmet": "^6.0.0", "jsonwebtoken": "^8.5.1", - "lodash.merge": "^4.6.2", "morgan": "~1.10.0", - "patch-package": "^6.4.7", "rate-limiter-flexible": "^2.4.1", "secure-password": "^4.0.0", - "superjson": "^1.12.2", - "uuid": "^9.0.0" + "superjson": "^1.12.2" }, "devDependencies": { "@tsconfig/node18": "latest", @@ -21,38 +18,32 @@ "@types/express": "^4.17.13", "@types/express-serve-static-core": "^4.17.13", "@types/node": "^18.0.0", - "@types/uuid": "^9.0.0", "nodemon": "^2.0.19", - "prisma": "4.16.2", - "standard": "^17.0.0", - "typescript": "^5.1.0" + "rollup": "^4.9.6", + "rollup-plugin-esbuild": "^6.1.1", + "standard": "^17.0.0" }, "engineStrict": true, "engines": { - "node": ">=18.0.0" + "node": ">=18.18.0" }, "name": "server", "nodemonConfig": { "delay": "1000" }, - "overrides": { - "secure-password": { - "sodium-native": "3.3.0" - } - }, + "overrides": {}, "prisma": {}, "private": true, "scripts": { - "build": "npx tsc", - "build-and-start": "npm run build && npm run start", + "bundle": "rollup --config --silent", + "bundle-and-start": "npm run bundle && npm run start", "db-migrate-prod": "prisma migrate deploy --schema=../db/schema.prisma", - "db-seed": "npm run build && NODE_PATH=dist node -r dotenv/config dist/dbSeed.js", - "postinstall": "patch-package", + "db-seed": "npm run bundle && node --enable-source-maps -r dotenv/config bundle/dbSeed.js", "standard": "standard", - "start": "npm run validate-env && NODE_PATH=dist node -r dotenv/config dist/server.js", + "start": "npm run validate-env && node --enable-source-maps -r dotenv/config bundle/server.js", "start-production": "NODE_ENV=production npm run start", "validate-env": "node -r dotenv/config ./scripts/validate-env.mjs", - "watch": "nodemon --exec 'npm run build-and-start || exit 1'" + "watch": "nodemon --exec 'npm run bundle-and-start || exit 1'" }, "type": "module", "version": "0.0.0" diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/rollup.config.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/rollup.config.js new file mode 100644 index 0000000000..9f0b986fb9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/rollup.config.js @@ -0,0 +1,24 @@ +import esbuild from 'rollup-plugin-esbuild' + +export default [ + createBundle('src/server.ts', 'bundle/server.js'), +] + +function createBundle(inputFilePath, outputFilePath) { + return { + input: inputFilePath, + output: { + file: outputFilePath, + format: 'es', + sourcemap: true, + }, + plugins: [ + esbuild({ + target: 'esnext', + }), + ], + // We don't want to bundle any of the node_module deps + // as we want to keep them as external dependencies + external: (id) => !/^[./]/.test(id), + } +} diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/scripts/validate-env.mjs index fb68580bbb..ac264b7961 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/scripts/validate-env.mjs +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/scripts/validate-env.mjs @@ -1,4 +1,4 @@ -import { throwIfNotValidAbsoluteURL } from './universal/validators.mjs'; +import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; console.info("🔍 Validating environment variables..."); throwIfNotValidAbsoluteURL(process.env.WASP_WEB_CLIENT_URL, 'Environment variable WASP_WEB_CLIENT_URL'); diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/actions/types.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/actions/types.ts index b5fa48def7..183065b864 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/actions/types.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/actions/types.ts @@ -1,4 +1,4 @@ import { type Payload, -} from '../_types' +} from 'wasp/server/_types' diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/app.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/app.js index a15cb96cea..025a3c4c14 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/app.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/app.js @@ -1,6 +1,6 @@ import express from 'express' -import HttpError from './core/HttpError.js' +import { HttpError } from 'wasp/server' import indexRouter from './routes/index.js' // TODO: Consider extracting most of this logic into createApp(routes, path) function so that diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/core/AuthError.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/core/AuthError.js deleted file mode 100644 index 2d965c168e..0000000000 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/core/AuthError.js +++ /dev/null @@ -1,17 +0,0 @@ -class AuthError extends Error { - constructor (message, data, ...params) { - super(message, ...params) - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, AuthError) - } - - this.name = this.constructor.name - - if (data) { - this.data = data - } - } -} - -export default AuthError diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/dbClient.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/dbClient.ts deleted file mode 100644 index 66e7801be3..0000000000 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/dbClient.ts +++ /dev/null @@ -1,12 +0,0 @@ -import Prisma from '@prisma/client' - - -const createDbClient = () => { - const prismaClient = new Prisma.PrismaClient() - - return prismaClient -} - -const dbClient = createDbClient() - -export default dbClient diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/dbSeed/types.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/dbSeed/types.ts deleted file mode 100644 index fe0d5396a4..0000000000 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/dbSeed/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { PrismaClient } from '@prisma/client' - -export type DbSeedFn = (prismaClient: PrismaClient) => Promise diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/middleware/globalMiddleware.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/middleware/globalMiddleware.ts index 2eca3e9f74..ce46c57ead 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/middleware/globalMiddleware.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/middleware/globalMiddleware.ts @@ -4,14 +4,12 @@ import logger from 'morgan' import cors from 'cors' import helmet from 'helmet' -import config from '../config.js' +import { config } from 'wasp/server' +import type { MiddlewareConfig, MiddlewareConfigFn } from 'wasp/server/middleware' +export type { MiddlewareConfig, MiddlewareConfigFn } from 'wasp/server/middleware' const _waspGlobalMiddlewareConfigFn = (mc: MiddlewareConfig) => mc -export type MiddlewareConfig = Map - -export type MiddlewareConfigFn = (middlewareConfig: MiddlewareConfig) => MiddlewareConfig - // This is the set of middleware Wasp supplies by default. // NOTE: Remember to update the docs of these change. const defaultGlobalMiddlewareConfig: MiddlewareConfig = new Map([ diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/middleware/operations.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/middleware/operations.ts index cea765236b..a86f8a8157 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/middleware/operations.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/middleware/operations.ts @@ -2,7 +2,7 @@ import { deserialize as superjsonDeserialize, serialize as superjsonSerialize, } from 'superjson' -import { handleRejection } from '../utils.js' +import { handleRejection } from 'wasp/server/utils' export function createOperation (handlerFn) { return handleRejection(async (req, res) => { diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/queries/types.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/queries/types.ts index 8024d29f08..a156fb294a 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/queries/types.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/queries/types.ts @@ -1,5 +1,5 @@ import { type Payload, -} from '../_types' +} from 'wasp/server/_types' diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/server.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/server.ts index fff57f199b..b8b7e0c0b3 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/server.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/server.ts @@ -1,7 +1,7 @@ import http from 'http' import app from './app.js' -import config from './config.js' +import { config } from 'wasp/server' diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/tsconfig.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/tsconfig.json index f0ce78775e..68d7a47b0d 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/tsconfig.json +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/tsconfig.json @@ -2,7 +2,33 @@ "extends": "@tsconfig/node18/tsconfig.json", "compilerOptions": { // Overriding this until we implement more complete TypeScript support. + // Filip: begin client file hacks + // We need this to make server work with copied client files (we copy everything) + "jsx": "preserve", + "lib": [ + "esnext", + "dom", + "DOM.Iterable" + ], + // Filip: end client file hacks "strict": false, + // When left unspecified, the 'rootDir' defaults to the longest common path of + // all non-declaration input files. TypeScript mimics the source structure + // inside the output directory (i.e., 'dist'). + // + // Since Wasp apps can (but don't have to) import user files from + // '../../../src', it makes the rootDir's default value inconsistent: + // - When the app doesn't import user files (e.g., the user didn't specify + // any operations), the rootDir is set to the server source dir (/src). + // - When the app imports user files (as is the case for most Wasp apps), + // the rootDir is set to the Wasp project root (../../../). + // + // Our build script (in package.json) requires a consistent structure of + // the output directory, which is why we always make sure to point the rootDir + // to the Wasp project root (../../../). + // + // See this comment for more details: https://github.com/wasp-lang/wasp/pull/1584#discussion_r1404019301 + "rootDir": "../../../", // Overriding this because we want to use top-level await "module": "esnext", "target": "es2017", @@ -10,12 +36,13 @@ "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 }, - "include": ["src"] -} + "include": [ + "src" + ] +} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/package.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/package.json index a539168d9f..f177c39597 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/package.json +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/package.json @@ -12,35 +12,24 @@ ] }, "dependencies": { - "@prisma/client": "4.16.2", "@tanstack/react-query": "^4.29.0", "axios": "^1.4.0", "mitt": "3.0.0", - "react": "^18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.45.4", "react-router-dom": "^5.3.3", "superjson": "^1.12.2" }, "devDependencies": { - "@testing-library/jest-dom": "^5.16.5", - "@testing-library/react": "^14.0.0", "@tsconfig/vite-react": "^2.0.0", - "@types/react": "^18.0.37", "@types/react-dom": "^18.0.11", "@types/react-router-dom": "^5.3.3", - "@vitejs/plugin-react-swc": "^3.0.0", - "@vitest/ui": "^0.29.3", - "dotenv": "^16.0.3", - "jsdom": "^21.1.1", - "msw": "^1.1.0", - "typescript": "^5.1.0", - "vite": "^4.3.9", - "vitest": "^0.29.3" + "@vitejs/plugin-react": "^4.2.1", + "dotenv": "^16.0.3" }, "engineStrict": true, "engines": { - "node": ">=18.0.0" + "node": ">=18.18.0" }, "name": "waspCompile", "private": true, diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/public/.gitkeep b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/public/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/scripts/validate-env.mjs index 27d6a9fd59..18ee507c9e 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/scripts/validate-env.mjs +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/scripts/validate-env.mjs @@ -1,4 +1,4 @@ -import { throwIfNotValidAbsoluteURL } from './universal/validators.mjs'; +import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; console.info("🔍 Validating environment variables..."); throwIfNotValidAbsoluteURL(process.env.REACT_APP_API_URL, 'Environemnt variable REACT_APP_API_URL'); diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/ext-src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/ext-src/vite-env.d.ts deleted file mode 100644 index 1623b9c79c..0000000000 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/ext-src/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/index.tsx b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/index.tsx index 17d6749e4a..0b7f1d9854 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/index.tsx +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/index.tsx @@ -6,7 +6,7 @@ import router from './router' import { initializeQueryClient, queryClientInitialized, -} from './queryClient' +} from 'wasp/client/operations' diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/queries/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/queries/index.d.ts deleted file mode 100644 index c007ff4c92..0000000000 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/queries/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { UseQueryResult } from "@tanstack/react-query"; - -export type Query = { - (queryCacheKey: string[], args: Input): Promise -} - -export function useQuery( - queryFn: Query, - queryFnArgs?: Input, options?: any -): UseQueryResult diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/queries/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/queries/index.js deleted file mode 100644 index 03e52ce0f9..0000000000 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/queries/index.js +++ /dev/null @@ -1,18 +0,0 @@ -import { useQuery as rqUseQuery } from '@tanstack/react-query' -export { configureQueryClient } from '../queryClient' - -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 - }) -} diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/router.tsx b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/router.tsx index a18069e2e3..b5ca2c4620 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/router.tsx +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/router.tsx @@ -1,27 +1,15 @@ import React from 'react' import { Route, Switch, BrowserRouter as Router } from 'react-router-dom' -import { interpolatePath } from './router/linkHelpers' -import type { - RouteDefinitionsToRoutes, - OptionalRouteOptions, - ParamValue, -} from './router/types' -import MainPage from './ext-src/MainPage.jsx' +import { MainPage } from '../../../../src/MainPage.jsx' -export const routes = { - RootRoute: { - to: "/", - component: MainPage, - build: ( - options?: OptionalRouteOptions, - ) => interpolatePath("/", undefined, options.search, options.hash), - }, -} as const; +import { routes } from 'wasp/client/router' -export type Routes = RouteDefinitionsToRoutes +export const routeNameToRouteComponent = { + RootRoute: MainPage, +} as const; const router = ( @@ -31,7 +19,7 @@ const router = ( exact key={routeKey} path={route.to} - component={route.component} + component={routeNameToRouteComponent[routeKey]} /> ))} @@ -39,5 +27,3 @@ const router = ( ) export default router - -export { Link } from './router/Link' diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/test/vitest/setup.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/test/vitest/setup.ts index d263e51f4f..f62fc46590 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/test/vitest/setup.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/test/vitest/setup.ts @@ -1,4 +1,8 @@ -import matchers from '@testing-library/jest-dom/matchers' -import { expect } from 'vitest' +import { afterEach } from 'vitest' +import { cleanup } from '@testing-library/react' +import '@testing-library/jest-dom/vitest' -expect.extend(matchers) +// runs a clean after each test case (e.g. clearing jsdom) +afterEach(() => { + cleanup(); +}) diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/tsconfig.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/tsconfig.json index 968a1bb47f..4e7d14e1cd 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/tsconfig.json +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/tsconfig.json @@ -6,8 +6,14 @@ "allowJs": true, "strict": false, // Allow importing pages with the .tsx extension. - "allowImportingTsExtensions": true + "allowImportingTsExtensions": true, }, - "include": ["src"], - "references": [{ "path": "./tsconfig.node.json" }] -} + "include": [ + "src" + ], + "references": [ + { + "path": "./tsconfig.node.json" + } + ] +} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/vite.config.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/vite.config.ts index 0bc670f493..ed2d3dd5f0 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/vite.config.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/vite.config.ts @@ -1,13 +1,19 @@ /// import { mergeConfig } from "vite"; -import react from "@vitejs/plugin-react-swc"; +import react from "@vitejs/plugin-react"; +import { defaultExclude } from "vitest/config" -import customViteConfig from './src/ext-src/vite.config' +// Ignoring the TS error because we are importing a file outside of TS root dir. +// @ts-ignore +import customViteConfig from '../../../vite.config' const _waspUserProvidedConfig = customViteConfig const defaultViteConfig = { base: "/", plugins: [react()], + optimizeDeps: { + exclude: ['wasp'] + }, server: { port: 3000, host: "0.0.0.0", @@ -17,9 +23,22 @@ const defaultViteConfig = { build: { outDir: "build", }, + resolve: { + // These packages rely on a single instance per page. Not dedpuing them + // causes runtime errors (e.g., hook rule violation in react, QueryClient + // instance error in react-query, Invariant Error in react-router-dom). + dedupe: ["react", "react-dom", "@tanstack/react-query", "react-router-dom"] + }, test: { + globals: true, environment: "jsdom", - setupFiles: ["./src/test/vitest/setup.ts"], + // Since Vitest is running from the root of the project, we need + // to specify the path to the setup file relative to the root. + setupFiles: ['.wasp/out/web-app/src/test/vitest/setup.ts'], + exclude: [ + ...defaultExclude, + ".wasp/**/*", + ] }, }; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/.waspignore b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.waspignore similarity index 100% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/.waspignore rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.waspignore diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/main.wasp b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/main.wasp index 793b47c209..77ba73c623 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/main.wasp +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/main.wasp @@ -7,5 +7,5 @@ app waspCompile { route RootRoute { path: "/", to: MainPage } page MainPage { - component: import Main from "@client/MainPage.jsx" + component: import { MainPage } from "@src/MainPage.jsx" } diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/package.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/package.json new file mode 100644 index 0000000000..988bbc5562 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/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": "waspCompile" +} diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/public/.gitkeep b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/public/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/client/Main.css b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/Main.css similarity index 100% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/client/Main.css rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/Main.css diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/ext-src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/MainPage.jsx similarity index 81% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/ext-src/MainPage.jsx rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/MainPage.jsx index c53ad8abaa..01aae7c3db 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/ext-src/MainPage.jsx +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/MainPage.jsx @@ -1,7 +1,7 @@ -import waspLogo from './waspLogo.png' -import './Main.css' +import waspLogo from "./waspLogo.png"; +import "./Main.css"; -const MainPage = () => { +export function MainPage() { return (
@@ -9,7 +9,9 @@ const MainPage = () => { wasp
-

Welcome to Wasp - you just started a new app!

+

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

This is page MainPage located at route /. Open src/client/MainPage.jsx to edit it. @@ -35,6 +37,5 @@ const MainPage = () => { - ) + ); } -export default MainPage diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/client/tsconfig.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/client/tsconfig.json deleted file mode 100644 index d501a4193a..0000000000 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/client/tsconfig.json +++ /dev/null @@ -1,55 +0,0 @@ -// =============================== IMPORTANT ================================= -// -// This file is only used for Wasp IDE support. You can change it to configure -// your IDE checks, but none of these options will affect the TypeScript -// compiler. Proper TS compiler configuration in Wasp is coming soon :) -{ - "compilerOptions": { - // JSX support - "jsx": "preserve", - "strict": true, - // Allow default imports. - "esModuleInterop": true, - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - // Wasp needs the following settings enable IDE support in your source - // files. Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/web-app/", - "paths": { - // Resolve all "@wasp" imports to the generated source code. - "@wasp/*": [ - "src/*" - ], - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": [ - "../../.wasp/out/web-app/node_modules/@types" - ], - // Since this TS config is used only for IDE support and not for - // compilation, the following directory doesn't exist. We need to specify - // it to prevent this error: - // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file - "outDir": "phantom" - }, - "exclude": [ - "phantom" - ], -} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/client/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/client/vite-env.d.ts deleted file mode 100644 index 1623b9c79c..0000000000 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/client/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/server/tsconfig.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/server/tsconfig.json deleted file mode 100644 index 70a79b44ee..0000000000 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/server/tsconfig.json +++ /dev/null @@ -1,48 +0,0 @@ -// =============================== IMPORTANT ================================= -// -// This file is only used for Wasp IDE support. You can change it to configure -// your IDE checks, but none of these options will affect the TypeScript -// compiler. Proper TS compiler configuration in Wasp is coming soon :) -{ - "compilerOptions": { - // Allows default imports. - "esModuleInterop": true, - "allowJs": true, - "strict": true, - // Wasp needs the following settings enable IDE support in your source - // files. Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/server/", - "paths": { - // Resolve all "@wasp" imports to the generated source code. - "@wasp/*": [ - "src/*" - ], - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": [ - "../../.wasp/out/server/node_modules/@types" - ], - // Since this TS config is used only for IDE support and not for - // compilation, the following directory doesn't exist. We need to specify - // it to prevent this error: - // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file - "outDir": "phantom", - }, - "exclude": [ - "phantom" - ], -} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/shared/tsconfig.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/shared/tsconfig.json deleted file mode 100644 index 20fcac8431..0000000000 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/shared/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - // Enable default imports in TypeScript. - "esModuleInterop": true, - "allowJs": true, - // The following settings enable IDE support in user-provided source files. - // Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/server/", - "paths": { - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": ["../../.wasp/out/server/node_modules/@types"] - } -} diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/client/waspLogo.png b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/waspLogo.png similarity index 100% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/client/waspLogo.png rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/waspLogo.png diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/tsconfig.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/tsconfig.json new file mode 100644 index 0000000000..a05fb4efd3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/tsconfig.json @@ -0,0 +1,34 @@ +// =============================== IMPORTANT ================================= +// +// This file is only used for Wasp IDE support. You can change it to configure +// your IDE checks, but none of these options will affect the TypeScript +// compiler. Proper TS compiler configuration in Wasp is coming soon :) +{ + "compilerOptions": { + // JSX support + "jsx": "preserve", + "strict": true, + // Allow default imports. + "esModuleInterop": true, + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "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" + ], + // Since this TS config is used only for IDE support and not for + // compilation, the following directory doesn't exist. We need to specify + // it to prevent this error: + // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file + "outDir": "phantom", + }, + "exclude": [ + "phantom" + ], +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/client/vite.config.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/vite.config.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/src/client/vite.config.ts rename to waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/vite.config.ts diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest b/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest index ee6b2469e7..9f3689c782 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest @@ -2,69 +2,437 @@ waspComplexTest/.env.server waspComplexTest/.wasp/out/.dockerignore waspComplexTest/.wasp/out/.waspchecksums waspComplexTest/.wasp/out/Dockerfile -waspComplexTest/.wasp/out/db/package.json waspComplexTest/.wasp/out/db/schema.prisma waspComplexTest/.wasp/out/db/schema.prisma.wasp-generate-checksum -waspComplexTest/.wasp/out/installedFullStackNpmDependencies.json +waspComplexTest/.wasp/out/installedNpmDepsLog.json +waspComplexTest/.wasp/out/sdk/wasp/api/events.ts +waspComplexTest/.wasp/out/sdk/wasp/api/index.ts +waspComplexTest/.wasp/out/sdk/wasp/auth/forms/Auth.tsx +waspComplexTest/.wasp/out/sdk/wasp/auth/forms/Login.tsx +waspComplexTest/.wasp/out/sdk/wasp/auth/forms/Signup.tsx +waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/Form.tsx +waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/Message.tsx +waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx +waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/social/SocialButton.tsx +waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/social/SocialIcons.tsx +waspComplexTest/.wasp/out/sdk/wasp/auth/forms/types.ts +waspComplexTest/.wasp/out/sdk/wasp/auth/helpers/Google.tsx +waspComplexTest/.wasp/out/sdk/wasp/auth/helpers/user.ts +waspComplexTest/.wasp/out/sdk/wasp/auth/index.ts +waspComplexTest/.wasp/out/sdk/wasp/auth/jwt.ts +waspComplexTest/.wasp/out/sdk/wasp/auth/logout.ts +waspComplexTest/.wasp/out/sdk/wasp/auth/lucia.ts +waspComplexTest/.wasp/out/sdk/wasp/auth/password.ts +waspComplexTest/.wasp/out/sdk/wasp/auth/providers/types.ts +waspComplexTest/.wasp/out/sdk/wasp/auth/session.ts +waspComplexTest/.wasp/out/sdk/wasp/auth/types.ts +waspComplexTest/.wasp/out/sdk/wasp/auth/useAuth.ts +waspComplexTest/.wasp/out/sdk/wasp/auth/user.ts +waspComplexTest/.wasp/out/sdk/wasp/auth/utils.ts +waspComplexTest/.wasp/out/sdk/wasp/auth/validation.ts +waspComplexTest/.wasp/out/sdk/wasp/client/auth/google.ts +waspComplexTest/.wasp/out/sdk/wasp/client/auth/index.ts +waspComplexTest/.wasp/out/sdk/wasp/client/auth/ui.ts +waspComplexTest/.wasp/out/sdk/wasp/client/crud/index.ts +waspComplexTest/.wasp/out/sdk/wasp/client/crud/tasks.ts +waspComplexTest/.wasp/out/sdk/wasp/client/index.ts +waspComplexTest/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts +waspComplexTest/.wasp/out/sdk/wasp/client/operations/actions/core.js +waspComplexTest/.wasp/out/sdk/wasp/client/operations/actions/index.ts +waspComplexTest/.wasp/out/sdk/wasp/client/operations/core.ts +waspComplexTest/.wasp/out/sdk/wasp/client/operations/index.ts +waspComplexTest/.wasp/out/sdk/wasp/client/operations/internal/index.ts +waspComplexTest/.wasp/out/sdk/wasp/client/operations/internal/resources.js +waspComplexTest/.wasp/out/sdk/wasp/client/operations/internal/updateHandlersMap.js +waspComplexTest/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts +waspComplexTest/.wasp/out/sdk/wasp/client/operations/queries/core.js +waspComplexTest/.wasp/out/sdk/wasp/client/operations/queries/index.ts +waspComplexTest/.wasp/out/sdk/wasp/client/operations/queryClient.ts +waspComplexTest/.wasp/out/sdk/wasp/client/router/Link.tsx +waspComplexTest/.wasp/out/sdk/wasp/client/router/index.ts +waspComplexTest/.wasp/out/sdk/wasp/client/router/linkHelpers.ts +waspComplexTest/.wasp/out/sdk/wasp/client/router/types.ts +waspComplexTest/.wasp/out/sdk/wasp/client/test/index.ts +waspComplexTest/.wasp/out/sdk/wasp/client/test/vitest/helpers.tsx +waspComplexTest/.wasp/out/sdk/wasp/core/auth.ts +waspComplexTest/.wasp/out/sdk/wasp/core/config.ts +waspComplexTest/.wasp/out/sdk/wasp/core/stitches.config.ts +waspComplexTest/.wasp/out/sdk/wasp/core/storage.ts +waspComplexTest/.wasp/out/sdk/wasp/dev/index.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/api/events.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/api/events.js +waspComplexTest/.wasp/out/sdk/wasp/dist/api/events.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Auth.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Auth.jsx +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Auth.jsx.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Login.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Login.jsx +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Login.jsx.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Signup.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Signup.jsx +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Signup.jsx.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.jsx +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.jsx.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.jsx +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.jsx.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.jsx +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.jsx.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialIcons.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialIcons.jsx +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialIcons.jsx.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/types.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/types.js +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/types.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/Google.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/Google.jsx +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/Google.jsx.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/user.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/user.js +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/user.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/jwt.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/jwt.js +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/jwt.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/logout.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/logout.js +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/logout.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/lucia.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/lucia.js +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/lucia.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/password.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/password.js +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/password.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/providers/types.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/providers/types.js +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/providers/types.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/types.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/types.js +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/types.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.js +waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/google.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/google.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/google.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/ui.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/ui.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/ui.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/core.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/core.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/Link.jsx +waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/types.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/types.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/types.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx +waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map +waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js +waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/core/config.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/core/config.js +waspComplexTest/.wasp/out/sdk/wasp/dist/core/config.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.js +waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/core/storage.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/core/storage.js +waspComplexTest/.wasp/out/sdk/wasp/dist/core/storage.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/dev/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/dev/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/dev/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/entities/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/entities/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/entities/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/App.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/App.jsx +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/App.jsx.map +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/myClientSetupCode.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/myClientSetupCode.js +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/myClientSetupCode.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/actions/bar.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/actions/bar.js +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/actions/bar.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apiNamespaces.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apiNamespaces.js +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apiNamespaces.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apis.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apis.js +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apis.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/returnHello.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/returnHello.js +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/returnHello.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/myServerSetupCode.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/myServerSetupCode.js +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/myServerSetupCode.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/queries/bar.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/queries/bar.js +waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/queries/bar.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/serialization.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/api/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/api/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/api/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/helpers.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/helpers.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/helpers.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/providers/sendgrid.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/providers/sendgrid.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/providers/sendgrid.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/types.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/types.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/types.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/job.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/types/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/types/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/types/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.js +waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.js +waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/universal/validators.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/universal/validators.js +waspComplexTest/.wasp/out/sdk/wasp/dist/universal/validators.js.map +waspComplexTest/.wasp/out/sdk/wasp/entities/index.ts +waspComplexTest/.wasp/out/sdk/wasp/ext-src/Main.css +waspComplexTest/.wasp/out/sdk/wasp/ext-src/MainPage.jsx +waspComplexTest/.wasp/out/sdk/wasp/ext-src/client/App.jsx +waspComplexTest/.wasp/out/sdk/wasp/ext-src/client/myClientSetupCode.js +waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/actions/bar.js +waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/apiNamespaces.ts +waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/apis.ts +waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/jobs/bar.js +waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/jobs/returnHello.ts +waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/myServerSetupCode.js +waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/queries/bar.js +waspComplexTest/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts +waspComplexTest/.wasp/out/sdk/wasp/ext-src/waspLogo.png +waspComplexTest/.wasp/out/sdk/wasp/package.json +waspComplexTest/.wasp/out/sdk/wasp/server/HttpError.ts +waspComplexTest/.wasp/out/sdk/wasp/server/_types/index.ts +waspComplexTest/.wasp/out/sdk/wasp/server/_types/serialization.ts +waspComplexTest/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts +waspComplexTest/.wasp/out/sdk/wasp/server/api/index.ts +waspComplexTest/.wasp/out/sdk/wasp/server/auth/index.ts +waspComplexTest/.wasp/out/sdk/wasp/server/config.ts +waspComplexTest/.wasp/out/sdk/wasp/server/crud/index.ts +waspComplexTest/.wasp/out/sdk/wasp/server/crud/tasks.ts +waspComplexTest/.wasp/out/sdk/wasp/server/dbClient.ts +waspComplexTest/.wasp/out/sdk/wasp/server/email/core/helpers.ts +waspComplexTest/.wasp/out/sdk/wasp/server/email/core/index.ts +waspComplexTest/.wasp/out/sdk/wasp/server/email/core/providers/sendgrid.ts +waspComplexTest/.wasp/out/sdk/wasp/server/email/core/types.ts +waspComplexTest/.wasp/out/sdk/wasp/server/email/index.ts +waspComplexTest/.wasp/out/sdk/wasp/server/index.ts +waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/job.ts +waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/index.ts +waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts +waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts +waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/types.ts +waspComplexTest/.wasp/out/sdk/wasp/server/jobs/index.ts +waspComplexTest/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts +waspComplexTest/.wasp/out/sdk/wasp/server/jobs/returnHelloJob.ts +waspComplexTest/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts +waspComplexTest/.wasp/out/sdk/wasp/server/middleware/index.ts +waspComplexTest/.wasp/out/sdk/wasp/server/operations/actions/index.ts +waspComplexTest/.wasp/out/sdk/wasp/server/operations/actions/types.ts +waspComplexTest/.wasp/out/sdk/wasp/server/operations/index.ts +waspComplexTest/.wasp/out/sdk/wasp/server/operations/queries/index.ts +waspComplexTest/.wasp/out/sdk/wasp/server/operations/queries/types.ts +waspComplexTest/.wasp/out/sdk/wasp/server/types/index.ts +waspComplexTest/.wasp/out/sdk/wasp/server/utils.ts +waspComplexTest/.wasp/out/sdk/wasp/tsconfig.json +waspComplexTest/.wasp/out/sdk/wasp/universal/types.ts +waspComplexTest/.wasp/out/sdk/wasp/universal/url.ts +waspComplexTest/.wasp/out/sdk/wasp/universal/validators.ts +waspComplexTest/.wasp/out/sdk/wasp/vite-env.d.ts waspComplexTest/.wasp/out/server/.env waspComplexTest/.wasp/out/server/.npmrc waspComplexTest/.wasp/out/server/README.md waspComplexTest/.wasp/out/server/nodemon.json waspComplexTest/.wasp/out/server/package.json -waspComplexTest/.wasp/out/server/patches/oauth+0.9.15.patch -waspComplexTest/.wasp/out/server/scripts/universal/validators.mjs +waspComplexTest/.wasp/out/server/rollup.config.js waspComplexTest/.wasp/out/server/scripts/validate-env.mjs -waspComplexTest/.wasp/out/server/src/_types/index.ts -waspComplexTest/.wasp/out/server/src/_types/serialization.ts -waspComplexTest/.wasp/out/server/src/_types/taggedEntities.ts -waspComplexTest/.wasp/out/server/src/actions/MySpecialAction.ts +waspComplexTest/.wasp/out/server/src/actions/mySpecialAction.ts waspComplexTest/.wasp/out/server/src/actions/types.ts -waspComplexTest/.wasp/out/server/src/apis/types.ts waspComplexTest/.wasp/out/server/src/app.js -waspComplexTest/.wasp/out/server/src/auth/jwt.ts -waspComplexTest/.wasp/out/server/src/auth/lucia.ts -waspComplexTest/.wasp/out/server/src/auth/password.ts waspComplexTest/.wasp/out/server/src/auth/providers/config/google.ts waspComplexTest/.wasp/out/server/src/auth/providers/index.ts waspComplexTest/.wasp/out/server/src/auth/providers/oauth/createRouter.ts waspComplexTest/.wasp/out/server/src/auth/providers/oauth/init.ts waspComplexTest/.wasp/out/server/src/auth/providers/oauth/types.ts -waspComplexTest/.wasp/out/server/src/auth/providers/types.ts -waspComplexTest/.wasp/out/server/src/auth/session.ts -waspComplexTest/.wasp/out/server/src/auth/user.ts -waspComplexTest/.wasp/out/server/src/auth/utils.ts -waspComplexTest/.wasp/out/server/src/auth/validation.ts -waspComplexTest/.wasp/out/server/src/config.js -waspComplexTest/.wasp/out/server/src/core/AuthError.js -waspComplexTest/.wasp/out/server/src/core/HttpError.js -waspComplexTest/.wasp/out/server/src/core/auth.js waspComplexTest/.wasp/out/server/src/crud/tasks.ts -waspComplexTest/.wasp/out/server/src/dbClient.ts -waspComplexTest/.wasp/out/server/src/dbSeed/types.ts -waspComplexTest/.wasp/out/server/src/email/core/helpers.ts -waspComplexTest/.wasp/out/server/src/email/core/index.ts -waspComplexTest/.wasp/out/server/src/email/core/providers/sendgrid.ts -waspComplexTest/.wasp/out/server/src/email/core/types.ts -waspComplexTest/.wasp/out/server/src/email/index.ts -waspComplexTest/.wasp/out/server/src/entities/index.ts -waspComplexTest/.wasp/out/server/src/ext-src/actions/bar.js -waspComplexTest/.wasp/out/server/src/ext-src/apiNamespaces.ts -waspComplexTest/.wasp/out/server/src/ext-src/apis.ts -waspComplexTest/.wasp/out/server/src/ext-src/jobs/bar.js -waspComplexTest/.wasp/out/server/src/ext-src/jobs/returnHello.ts -waspComplexTest/.wasp/out/server/src/ext-src/myServerSetupCode.js -waspComplexTest/.wasp/out/server/src/ext-src/queries/bar.js -waspComplexTest/.wasp/out/server/src/jobs/MySpecialJob.ts -waspComplexTest/.wasp/out/server/src/jobs/ReturnHelloJob.ts waspComplexTest/.wasp/out/server/src/jobs/core/allJobs.ts -waspComplexTest/.wasp/out/server/src/jobs/core/job.ts -waspComplexTest/.wasp/out/server/src/jobs/core/pgBoss/pgBoss.ts -waspComplexTest/.wasp/out/server/src/jobs/core/pgBoss/pgBossJob.ts +waspComplexTest/.wasp/out/server/src/jobs/mySpecialJob.ts +waspComplexTest/.wasp/out/server/src/jobs/returnHelloJob.ts waspComplexTest/.wasp/out/server/src/middleware/globalMiddleware.ts waspComplexTest/.wasp/out/server/src/middleware/index.ts waspComplexTest/.wasp/out/server/src/middleware/operations.ts waspComplexTest/.wasp/out/server/src/polyfill.ts -waspComplexTest/.wasp/out/server/src/queries/MySpecialQuery.ts +waspComplexTest/.wasp/out/server/src/queries/mySpecialQuery.ts waspComplexTest/.wasp/out/server/src/queries/types.ts waspComplexTest/.wasp/out/server/src/routes/apis/index.ts waspComplexTest/.wasp/out/server/src/routes/auth/index.js @@ -73,14 +441,10 @@ waspComplexTest/.wasp/out/server/src/routes/auth/me.js waspComplexTest/.wasp/out/server/src/routes/crud/index.ts waspComplexTest/.wasp/out/server/src/routes/crud/tasks.ts waspComplexTest/.wasp/out/server/src/routes/index.js -waspComplexTest/.wasp/out/server/src/routes/operations/MySpecialAction.js -waspComplexTest/.wasp/out/server/src/routes/operations/MySpecialQuery.js waspComplexTest/.wasp/out/server/src/routes/operations/index.js +waspComplexTest/.wasp/out/server/src/routes/operations/mySpecialAction.js +waspComplexTest/.wasp/out/server/src/routes/operations/mySpecialQuery.js waspComplexTest/.wasp/out/server/src/server.ts -waspComplexTest/.wasp/out/server/src/types/index.ts -waspComplexTest/.wasp/out/server/src/universal/types.ts -waspComplexTest/.wasp/out/server/src/universal/url.ts -waspComplexTest/.wasp/out/server/src/utils.ts waspComplexTest/.wasp/out/server/tsconfig.json waspComplexTest/.wasp/out/web-app/.env waspComplexTest/.wasp/out/web-app/.npmrc @@ -88,82 +452,32 @@ waspComplexTest/.wasp/out/web-app/README.md waspComplexTest/.wasp/out/web-app/index.html waspComplexTest/.wasp/out/web-app/netlify.toml waspComplexTest/.wasp/out/web-app/package.json +waspComplexTest/.wasp/out/web-app/public/.gitkeep waspComplexTest/.wasp/out/web-app/public/favicon.ico waspComplexTest/.wasp/out/web-app/public/manifest.json -waspComplexTest/.wasp/out/web-app/scripts/universal/validators.mjs waspComplexTest/.wasp/out/web-app/scripts/validate-env.mjs -waspComplexTest/.wasp/out/web-app/src/actions/MySpecialAction.ts -waspComplexTest/.wasp/out/web-app/src/actions/core.d.ts -waspComplexTest/.wasp/out/web-app/src/actions/core.js -waspComplexTest/.wasp/out/web-app/src/actions/index.ts -waspComplexTest/.wasp/out/web-app/src/api.ts -waspComplexTest/.wasp/out/web-app/src/api/events.ts -waspComplexTest/.wasp/out/web-app/src/auth/forms/Auth.tsx -waspComplexTest/.wasp/out/web-app/src/auth/forms/Login.tsx -waspComplexTest/.wasp/out/web-app/src/auth/forms/Signup.tsx -waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/Form.tsx -waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/Message.tsx -waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/common/LoginSignupForm.tsx -waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/social/SocialButton.tsx -waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/social/SocialIcons.tsx -waspComplexTest/.wasp/out/web-app/src/auth/forms/types.ts -waspComplexTest/.wasp/out/web-app/src/auth/helpers/Google.jsx -waspComplexTest/.wasp/out/web-app/src/auth/helpers/user.ts -waspComplexTest/.wasp/out/web-app/src/auth/logout.ts waspComplexTest/.wasp/out/web-app/src/auth/pages/OAuthCodeExchange.jsx waspComplexTest/.wasp/out/web-app/src/auth/pages/createAuthRequiredPage.jsx -waspComplexTest/.wasp/out/web-app/src/auth/types.ts -waspComplexTest/.wasp/out/web-app/src/auth/useAuth.ts -waspComplexTest/.wasp/out/web-app/src/auth/user.ts -waspComplexTest/.wasp/out/web-app/src/config.js -waspComplexTest/.wasp/out/web-app/src/crud/tasks.ts waspComplexTest/.wasp/out/web-app/src/entities/index.ts -waspComplexTest/.wasp/out/web-app/src/ext-src/App.jsx -waspComplexTest/.wasp/out/web-app/src/ext-src/Main.css -waspComplexTest/.wasp/out/web-app/src/ext-src/MainPage.jsx -waspComplexTest/.wasp/out/web-app/src/ext-src/myClientSetupCode.js -waspComplexTest/.wasp/out/web-app/src/ext-src/vite-env.d.ts -waspComplexTest/.wasp/out/web-app/src/ext-src/vite.config.ts -waspComplexTest/.wasp/out/web-app/src/ext-src/waspLogo.png waspComplexTest/.wasp/out/web-app/src/index.tsx waspComplexTest/.wasp/out/web-app/src/logo.png -waspComplexTest/.wasp/out/web-app/src/operations/index.ts -waspComplexTest/.wasp/out/web-app/src/operations/resources.js -waspComplexTest/.wasp/out/web-app/src/operations/updateHandlersMap.js -waspComplexTest/.wasp/out/web-app/src/queries/MySpecialQuery.ts -waspComplexTest/.wasp/out/web-app/src/queries/core.d.ts -waspComplexTest/.wasp/out/web-app/src/queries/core.js -waspComplexTest/.wasp/out/web-app/src/queries/index.d.ts -waspComplexTest/.wasp/out/web-app/src/queries/index.js waspComplexTest/.wasp/out/web-app/src/queryClient.js waspComplexTest/.wasp/out/web-app/src/router.tsx -waspComplexTest/.wasp/out/web-app/src/router/Link.tsx -waspComplexTest/.wasp/out/web-app/src/router/linkHelpers.ts -waspComplexTest/.wasp/out/web-app/src/router/types.ts -waspComplexTest/.wasp/out/web-app/src/stitches.config.js -waspComplexTest/.wasp/out/web-app/src/storage.ts -waspComplexTest/.wasp/out/web-app/src/test/index.ts -waspComplexTest/.wasp/out/web-app/src/test/vitest/helpers.tsx waspComplexTest/.wasp/out/web-app/src/test/vitest/setup.ts -waspComplexTest/.wasp/out/web-app/src/types.ts -waspComplexTest/.wasp/out/web-app/src/universal/types.ts -waspComplexTest/.wasp/out/web-app/src/universal/url.ts waspComplexTest/.wasp/out/web-app/src/utils.js waspComplexTest/.wasp/out/web-app/src/vite-env.d.ts waspComplexTest/.wasp/out/web-app/tsconfig.json waspComplexTest/.wasp/out/web-app/tsconfig.node.json waspComplexTest/.wasp/out/web-app/vite.config.ts +waspComplexTest/.waspignore waspComplexTest/.wasproot waspComplexTest/main.wasp -waspComplexTest/src/.waspignore +waspComplexTest/package.json +waspComplexTest/public/.gitkeep +waspComplexTest/src/Main.css +waspComplexTest/src/MainPage.jsx waspComplexTest/src/client/App.jsx -waspComplexTest/src/client/Main.css -waspComplexTest/src/client/MainPage.jsx waspComplexTest/src/client/myClientSetupCode.js -waspComplexTest/src/client/tsconfig.json -waspComplexTest/src/client/vite-env.d.ts -waspComplexTest/src/client/vite.config.ts -waspComplexTest/src/client/waspLogo.png waspComplexTest/src/server/actions/bar.js waspComplexTest/src/server/apiNamespaces.ts waspComplexTest/src/server/apis.ts @@ -171,5 +485,7 @@ waspComplexTest/src/server/jobs/bar.js waspComplexTest/src/server/jobs/returnHello.ts waspComplexTest/src/server/myServerSetupCode.js waspComplexTest/src/server/queries/bar.js -waspComplexTest/src/server/tsconfig.json -waspComplexTest/src/shared/tsconfig.json +waspComplexTest/src/vite-env.d.ts +waspComplexTest/src/waspLogo.png +waspComplexTest/tsconfig.json +waspComplexTest/vite.config.ts diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/.waspchecksums b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/.waspchecksums index cf657f8095..1d024a32b7 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/.waspchecksums @@ -2,1031 +2,1171 @@ [ [ "file", - ".dockerignore" + "../out/sdk/wasp/api/events.ts" ], - "a2a5ebe3785244437c0d490b4bfa1652c84b9ab0d4f25566fd7e69d1421d7a1b" + "91ec1889f649b608ca81cab8f048538b9dcc70f49444430b1e5b572af2a4970a" ], [ [ "file", - "Dockerfile" + "../out/sdk/wasp/api/index.ts" ], - "f50d77dfca7624b691d0e5b002aeb1b7dc3302c9a761fb06ad502893507c0ad1" + "6d69f0df651dd19d0a9cd137ee4a0d536358269b6bd91c25efaa6c254f06948a" ], [ [ "file", - "db/schema.prisma" + "../out/sdk/wasp/auth/forms/Auth.tsx" ], - "5a41561cd6f853da2f4b9f64267f5d4e3b2865f94dfa92d9143acf2c1485519c" + "16b55c00069d5bc994c94e4ba9126c68aa27acb3e12363c9de7e4b304f9f1e98" ], [ [ "file", - "server/.env" + "../out/sdk/wasp/auth/forms/Login.tsx" ], - "d9649485a674ce3c6b8d668a1253cde3bd8695cb3d2d3a6b7c573a3e2805c7ec" + "e7fe29ebd8681ed1cf5f4ddbb92a69aaa46a4877fad94371389c529e73ab722b" ], [ [ "file", - "server/.gitignore" + "../out/sdk/wasp/auth/forms/Signup.tsx" ], - "2c3d81dd719ff91d51609a02d03ba62ad456e2c50763b7b4c761395cb583f890" + "12cb8156332ce540a6003e3cb005215bc28e77f993f8e6efd3cdeef65a8163eb" ], [ [ "file", - "server/.npmrc" + "../out/sdk/wasp/auth/forms/internal/Form.tsx" ], - "8a74b1091affea3c71c2cf04acbaa38c4a51a261a9a98dcc9e96473d07a85a27" + "e35dd7deff739520c2ce6782168c3da1d69b1c9720c30e4bf12c387a2d84e043" ], [ [ "file", - "server/README.md" + "../out/sdk/wasp/auth/forms/internal/Message.tsx" ], - "e14514b8b152dd2160a217d8fc66a710c8607c4ed1441a2148a0770701818249" + "0975ace5bbd592d78097ea8891061346325bfd3d85f2980b52ea712d7207fcf8" ], [ [ "file", - "server/nodemon.json" + "../out/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx" ], - "c4c69994805c8e0d993bd39fec9e52478b5e656bae565fa1c19ef378901a7139" + "82c849f5a05a4c02cf37975cf9628200670a8517fac1d049aac8dff8e7962be2" ], [ [ "file", - "server/package.json" + "../out/sdk/wasp/auth/forms/internal/social/SocialButton.tsx" ], - "831f2505c29201cd8e5076fda768423448a6cbba92410b0692fd8ac630aeb76b" + "8c62f7c0fdf5f71db83c103ccf4194a55124cafb8a3b60aa1b9ccfa475a3aebf" ], [ [ "file", - "server/patches/oauth+0.9.15.patch" + "../out/sdk/wasp/auth/forms/internal/social/SocialIcons.tsx" ], - "8b19a9638456f4f111d1fe95c90e9b0843773abaae62a356e3530609072560d0" + "bca4b3d9bc1cd57bdc83ad51be235ac5a5f220e8b63a91dcce6da296f32f51c6" ], [ [ "file", - "server/scripts/universal/validators.mjs" + "../out/sdk/wasp/auth/forms/types.ts" ], - "94edf3906c43fb476b22244d07a5d69fd6c967de767532ed5b3215e2a6eee91b" + "8069774aaf815ddaa9e13737b7e5741eb5d7c1e72a8be6574f8ba56a53931016" ], [ [ "file", - "server/scripts/validate-env.mjs" + "../out/sdk/wasp/auth/helpers/Google.tsx" ], - "b507ff0f8cbdac18a0b42ccbb7acda9a5cd88e0ac5f95ca3d42341944298062d" + "301bcd7c5615ab733c976f9986a5628bd9c3ccfc2cd69056c002413d685199b3" ], [ [ "file", - "server/src/_types/index.ts" + "../out/sdk/wasp/auth/helpers/user.ts" ], - "e7678be590a77799133e99d07a3326bbc6e627a5a219db8714a1b3d3b3304150" + "44ddd44ee810e53f2d74507ba35d5e1fd1a2671870b11620a13f881b879f816e" ], [ [ "file", - "server/src/_types/serialization.ts" + "../out/sdk/wasp/auth/index.ts" ], - "73dc983c9a02cab8e2f189f1ddedd9cdcd47bf403c9dc56efba8be895b6980a1" + "f79d9aa0c8c5c0365c30c4db4e9c35946e1650266eeea1cf06fcce191211c911" ], [ [ "file", - "server/src/_types/taggedEntities.ts" + "../out/sdk/wasp/auth/jwt.ts" ], - "1d95c918d216f7cc79f1a861c29eb251794e1f1ea2ce53452a81928429a21430" + "adced7d9cc058bdf5832ad1bafdf5150c0c7dd2e6454148ddaa345f7a48d2738" ], [ [ "file", - "server/src/actions/MySpecialAction.ts" + "../out/sdk/wasp/auth/logout.ts" ], - "ccc1fe9bc8989fe3ea9e7629d89d9156f55836ccafc2aa51a46fcbf4e424141f" + "d117cb56168f65930e74c0f4879c8532324f8bf30da3030f95318a6f5aac5dd4" ], [ [ "file", - "server/src/actions/types.ts" + "../out/sdk/wasp/auth/lucia.ts" ], - "35cf6ae813ff02d73a23b9b9468975d86e4c89ee93079e48fd7f6bf3205f3451" + "66ed66be1f2c0b33c6a0546fa2ec2e4c633db123cb18106c6a3e108ba00f73a7" ], [ [ "file", - "server/src/apis/types.ts" + "../out/sdk/wasp/auth/password.ts" ], - "858df39f218f37d2500f8ea9847e6ff7a2e1b58214bbe717fe6b48651e7fc6a6" + "dfcf3e3fe8772049f3fb90fef0da794a759f990a4fef400ce08f9dbd107efa38" ], [ [ "file", - "server/src/app.js" + "../out/sdk/wasp/auth/providers/types.ts" ], - "86504ede1daeca35cc93f665ca8ac2fdf46ecaff02f6d3a7810a14d2bc71e16a" + "645ad70b2f5d91f6e14042547ba94b782644a4f12d62cbd9df1ed2e2081127c1" ], [ [ "file", - "server/src/auth/jwt.ts" + "../out/sdk/wasp/auth/session.ts" ], - "be637e3c0ac601c1b6edb4a5cc6a9300edfb7fb1568220672254524a6b395b89" + "b682047557c966d8f45e4ec1e27a0b4773cd5765af7864990edac6c0e3997db1" ], [ [ "file", - "server/src/auth/lucia.ts" + "../out/sdk/wasp/auth/types.ts" ], - "dc5e75c3e3da677c8e98d1456964f1f9bce9105bf90f3c351379e54d3433523b" + "81afde3e152e92d6888f5cf67ab60711ab9cd156e09408d2a618dd02a71371fe" ], [ [ "file", - "server/src/auth/password.ts" + "../out/sdk/wasp/auth/useAuth.ts" ], - "f9003f11bf1396bff69a98440543e6e131f50d5bc1269a8aae55d72615922705" + "d73f116f7761ab9685eb53ac20639e81aeac540b5f9bb986c5edea88329bc2f7" ], [ [ "file", - "server/src/auth/providers/config/google.ts" + "../out/sdk/wasp/auth/user.ts" ], - "3b6483ca304c77002f5cd4475ed8cb11617d210bfab169d85b82effc82836da8" + "07164ea63b1aa89fa6279994f42f19b6f3552f897e9d9214c8799cadd9089be3" ], [ [ "file", - "server/src/auth/providers/index.ts" + "../out/sdk/wasp/auth/utils.ts" ], - "e1c33c91fd91a2de63619320c462817234c097e18d3b04a11c63d4216bcaca85" + "d09d1b32eee179eefe96f34b52d520065a50a3617195de07b75c59e6c1705f69" ], [ [ "file", - "server/src/auth/providers/oauth/createRouter.ts" + "../out/sdk/wasp/auth/validation.ts" ], - "76e0bd6e17cdcea8c418c2577be8f39fa20db8d208eedafef679a1aee9cd1dae" + "1981d8fb5415493741e0483b3f998808c1978d9d80889895d9cf60a53ca86dd3" ], [ [ "file", - "server/src/auth/providers/oauth/init.ts" + "../out/sdk/wasp/client/auth/google.ts" ], - "e844a8225699db6d44cc59fb842c1142f44cfd53ee431aa6738c9971001b412b" + "69f61f22ac0a19eefc3770d2cf04fe6237a70439840bcab672648011fc5c178d" ], [ [ "file", - "server/src/auth/providers/oauth/types.ts" + "../out/sdk/wasp/client/auth/index.ts" ], - "9f1561dae6c728a2e93938e49cc4c51f11d332b74f7cf3ad6634acaf91bbd634" + "91f8445310f955f3a81ae855041d845c29c63d1d88e2b7847ad008c46a9f23bc" ], [ [ "file", - "server/src/auth/providers/types.ts" + "../out/sdk/wasp/client/auth/ui.ts" ], - "72cf71573f3ae1b5f49c7019001781a13f8617772d07926375ed6966164d4597" + "3763bf9cecf5c33dce80ea727084312b605a68b834fda5f9b18bcba6b0e56516" ], [ [ "file", - "server/src/auth/session.ts" + "../out/sdk/wasp/client/crud/index.ts" ], - "6edca533dbb38ddcba326fd0399dc6f5bc9b249327ed61c7c167d3a5a9d9a462" + "ca3b06b6c04c38c69523f435f6a15e9984414b440648708ea7227cd619b2f918" ], [ [ "file", - "server/src/auth/user.ts" + "../out/sdk/wasp/client/crud/tasks.ts" ], - "74080241b9011ddce54ac2452b7c8a7064a4070ef1b04e420c730c62d787e077" + "2114cf0cc99408b1bb501f8a278c90239349744f3593a9cd2f80cbea0b1fbbe3" ], [ [ "file", - "server/src/auth/utils.ts" + "../out/sdk/wasp/client/index.ts" ], - "9022854d0aa165227abb25a1f8c0a2c3985ce2ce1d624ebe807749dbaef94091" + "526d2f787c68b0be87064eb4c7771394f2987b6669b5fd39f9d240dcbfc2356c" ], [ [ "file", - "server/src/auth/validation.ts" + "../out/sdk/wasp/client/operations/actions/core.d.ts" ], - "783b39cd48e2b47a1e6eea2f9153d7aeafd4c3145d6b17c56d9b8eb6cf82b835" + "676855c039620769cc6ac728149d263c438024e5888ea0afd7f575507a95682a" ], [ [ "file", - "server/src/config.js" + "../out/sdk/wasp/client/operations/actions/core.js" ], - "e4b647166ce3a74d1260f3505ce6366b52d195d6d1dcb75929b3fef30ea9ea4d" + "620a4aefbab701dd47b8bf21a07fc4e081ae1fd297261c5af7a05f21f558dff1" ], [ [ "file", - "server/src/core/AuthError.js" + "../out/sdk/wasp/client/operations/actions/index.ts" ], - "5ac18ed20c5c8b192a75d1cb2f36906d5ff9f0951451a2ef08d9ab62fc26b8bb" + "07a89a48067ffd42c0513303b662ae612b93216924e6f432394d73a2f7339f5b" ], [ [ "file", - "server/src/core/HttpError.js" + "../out/sdk/wasp/client/operations/core.ts" ], - "fa06ff60ab8183e8d00c13805692fc8cd3b5a21408edce4f0949d5b913e066b1" + "bad860771b16a0d4830fab22de8b85e63c840d47dc3728728a23b8ada91061ef" ], [ [ "file", - "server/src/core/auth.js" + "../out/sdk/wasp/client/operations/index.ts" ], - "c6563934d31312dc92af13ebdac56d30a4672c7419be8a72f5666e8e4635f653" + "4a66c90319dd7ef0d3a8e6c1f571037c7dfd9778b9def6e951813dbc4b4dcef3" ], [ [ "file", - "server/src/crud/tasks.ts" + "../out/sdk/wasp/client/operations/internal/index.ts" ], - "3dbc7ee4341bc00af125c02d4b771bc7e7fb5bc7063191d659e7243217e2761f" + "0cd5c744f0d883d48a6c1ddf8eacbe48059e123e79c5f39fad2d17073b6c9f9e" + ], + [ + [ + "file", + "../out/sdk/wasp/client/operations/internal/resources.js" + ], + "0f3a0e4d19ceff419a6343ab5162d8b0985673f9d3d7d76bd4471fae0076fe17" + ], + [ + [ + "file", + "../out/sdk/wasp/client/operations/internal/updateHandlersMap.js" + ], + "07a9933a771853585fd2fc49c3dcb9f1cad947acb2168580c835fae25620fa9f" ], [ [ "file", - "server/src/dbClient.ts" + "../out/sdk/wasp/client/operations/queries/core.d.ts" ], - "f26bfa4a60022d45195f3179548c4b09305f6a9cfe301b5edd1615677a59ae3f" + "8ca19541652926772e2a7c5d88b5497b7760e98bc9d19c9a217bd03d83cec97d" ], [ [ "file", - "server/src/dbSeed/types.ts" + "../out/sdk/wasp/client/operations/queries/core.js" ], - "47442c546d286164c2cdb3359deb45b47f115df2ca72bb181b4639bee2059d38" + "34425abc901cd6294ca902df6b0c080aeafe2b3abf5b539c5e622020601f838e" ], [ [ "file", - "server/src/email/core/helpers.ts" + "../out/sdk/wasp/client/operations/queries/index.ts" ], - "b59fd329fc96e47f2839ba0b06ea5e42935e4959d228676be9c13ddb30d9e02c" + "7da06d47effd9b6d38ce110bf3ed989a5e260fb9fac9fe96c6acb1917742583d" ], [ [ "file", - "server/src/email/core/index.ts" + "../out/sdk/wasp/client/operations/queryClient.ts" ], - "d524dd9ef27cd311340060411276df0e8ef22db503473f44281832338b954bb7" + "5c1d87ac10513788bcde7ebc7c10601b9ad0854cddff355e8fb7e2d4685ecdef" ], [ [ "file", - "server/src/email/core/providers/sendgrid.ts" + "../out/sdk/wasp/client/router/Link.tsx" ], - "b1a16455eede9723f6ae43c03e628b4129fd96f7300f004f052f1eab31d9b95b" + "80db39a38f50833f8c965bfd7758da990083db60a6f2f8e394353eed5f981cc9" ], [ [ "file", - "server/src/email/core/types.ts" + "../out/sdk/wasp/client/router/index.ts" ], - "0d7c19707f4e7c498a458015b1065b3f84c31e53ba73807707a05b7293473eb2" + "6fe430c2956c25c3833d6893c695523a7b2a5f1cb9eceb0bed26429c2e33e6a0" ], [ [ "file", - "server/src/email/index.ts" + "../out/sdk/wasp/client/router/linkHelpers.ts" ], - "4443efa3da16d8d950bde84acd2ed6d9bc3a5d211ce3138248e3b5bad5079978" + "62e48c724070c59a95c837288112922326e1351ee1defa4759bdc47f7361ce9e" ], [ [ "file", - "server/src/entities/index.ts" + "../out/sdk/wasp/client/router/types.ts" + ], + "d6feb23110d8cae5c94badd5cdec320207e1a5406cb827eb684aa4cffc3d7050" + ], + [ + [ + "file", + "../out/sdk/wasp/client/test/index.ts" + ], + "cb2e2dc33df8afc0d4453f4322a4e2af92f3345e9622e0416fa87e34d6acb9d8" + ], + [ + [ + "file", + "../out/sdk/wasp/client/test/vitest/helpers.tsx" + ], + "e0fbaf237a21b52ff47897fb1f1b1bffb0085670b71ba7d0b1d90547ab5a8f3b" + ], + [ + [ + "file", + "../out/sdk/wasp/core/auth.ts" + ], + "489b2f1840c2d44bdf16f6a949f7217c55c5569a931c3ca9f8484571428840e6" + ], + [ + [ + "file", + "../out/sdk/wasp/core/config.ts" + ], + "12a7dffb1c3fe762cec8d9d928af353cb169ff199d3934b1f3c27ce0e3a2f987" + ], + [ + [ + "file", + "../out/sdk/wasp/core/stitches.config.ts" + ], + "f238234a9db89d6a34c7a8c7c948a58c011da8e167ff94d72e7c6808beb4e177" + ], + [ + [ + "file", + "../out/sdk/wasp/core/storage.ts" + ], + "e9e2a4a02d48bea1597fcdc00592e3d975eea7fa6e0545cf087da9429c5f4979" + ], + [ + [ + "file", + "../out/sdk/wasp/dev/index.ts" + ], + "1c15a2858ffe39f3ef83e53705cb25b00f09e895c04cf1a354210b5babdde895" + ], + [ + [ + "file", + "../out/sdk/wasp/entities/index.ts" ], "cdd9cdbeebfdad8c54ddbf4978a3c4974faa66df05b87b42a5030fcc214394f8" ], [ [ "file", - "server/src/ext-src/actions/bar.js" + "../out/sdk/wasp/ext-src/Main.css" + ], + "1583ce49887ea575e563dab0c7ad6d2e2e3e6a351ed7c2f80c310641b1456417" + ], + [ + [ + "file", + "../out/sdk/wasp/ext-src/MainPage.jsx" + ], + "4aead352bd5bbb5134b5e1f0927cf94966d80aa9dbbbb1f616e79fec8ae594e4" + ], + [ + [ + "file", + "../out/sdk/wasp/ext-src/client/App.jsx" + ], + "b23058c8652ddb88b8e147e20fb97c7e90c076b5224314f6a3ab4c620957c0ae" + ], + [ + [ + "file", + "../out/sdk/wasp/ext-src/client/myClientSetupCode.js" + ], + "32219bbb2a8d08dfa8447255b922c9d0d202d21a38e2fbc281b62b181b6f5134" + ], + [ + [ + "file", + "../out/sdk/wasp/ext-src/server/actions/bar.js" ], "83c606a3eee7608155cdb2c2a20a38f851a82987e060ce25b196b467092c4740" ], [ [ "file", - "server/src/ext-src/apiNamespaces.ts" + "../out/sdk/wasp/ext-src/server/apiNamespaces.ts" ], - "33ea32722151840f2591036f3f548a7af96d5218aea6468ac94fd3c0fe05cb78" + "8a27c47d14431169145dfc5dcd79d13d555614c192578063ae864974ddf344b8" ], [ [ "file", - "server/src/ext-src/apis.ts" + "../out/sdk/wasp/ext-src/server/apis.ts" ], - "3d00118d2b80472e7efb24c89d309471ad5e0e9c6212f5dda908eebe8436d99d" + "63ca559e4953465d8489df414ddc3f2c8455bcae85177b47d64b8a765e475831" ], [ [ "file", - "server/src/ext-src/jobs/bar.js" + "../out/sdk/wasp/ext-src/server/jobs/bar.js" ], "83c606a3eee7608155cdb2c2a20a38f851a82987e060ce25b196b467092c4740" ], [ [ "file", - "server/src/ext-src/jobs/returnHello.ts" + "../out/sdk/wasp/ext-src/server/jobs/returnHello.ts" ], - "d10f5cd03a04f6db430b74f98834a3f128ed2c4663828d05ca04d1fccf3a0f0f" + "5464150fb208a5a3124cc7bd8ad07c3da426fd7dde2348ead587094fd4a49767" ], [ [ "file", - "server/src/ext-src/myServerSetupCode.js" + "../out/sdk/wasp/ext-src/server/myServerSetupCode.js" ], "a5819016c8dd9e370e9ce89cd636a33c6eafa55f8fa38f31c3af453526f77cc2" ], [ [ "file", - "server/src/ext-src/queries/bar.js" + "../out/sdk/wasp/ext-src/server/queries/bar.js" ], "83c606a3eee7608155cdb2c2a20a38f851a82987e060ce25b196b467092c4740" ], [ [ "file", - "server/src/jobs/MySpecialJob.ts" + "../out/sdk/wasp/ext-src/vite-env.d.ts" ], - "f75ff9a6f207fdb8adc94843d78ef0f7504588f8bdb686347692ece3284d9aa8" + "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5" ], [ [ "file", - "server/src/jobs/ReturnHelloJob.ts" + "../out/sdk/wasp/ext-src/waspLogo.png" ], - "d3d5cf184c0d984ea9ed4f6e461f9ff2058cfdffe51738fc66f64c33abc1306a" + "0f05a89eb945d6d7326110e88776e402833b356202b06d0a8bf652e118d3fd2f" ], [ [ "file", - "server/src/jobs/core/allJobs.ts" + "../out/sdk/wasp/package.json" ], - "10a3ef50675a8de2d6c86b4677471c673a2f89f01670ec9e9c98e1dd3754f167" + "5d72459af3a4e005f73ab8d7fa818b1e8e9225dfdf650809e64e620a22af7e43" ], [ [ "file", - "server/src/jobs/core/job.ts" + "../out/sdk/wasp/server/HttpError.ts" ], - "c10df70eb886d6cd132b8a0b4f619dc500bbd4ec3174ef156cdad41be8cce021" + "eaa296c30acc65c78b90ebdf9a1d6fdb863f0c26c743d352afaeaa3bbc2fdd1b" ], [ [ "file", - "server/src/jobs/core/pgBoss/pgBoss.ts" + "../out/sdk/wasp/server/_types/index.ts" ], - "4ca3ab19aa84a0ac4f62f6d9b3ee2304fd41ab6649320473d975ae438e3c3cfd" + "6993d64660f25759a15ccde4cd1f3a18e651044d362a348912203c0ba2284588" ], [ [ "file", - "server/src/jobs/core/pgBoss/pgBossJob.ts" + "../out/sdk/wasp/server/_types/serialization.ts" ], - "700b83862734d7ee752f685381de30fa730580fb950fbc61d168f51d1fe44bb4" + "cfa5bcdd91e36fe35a91323bd3944a52873144101a5a03ae8a4f258cdd61ea03" ], [ [ "file", - "server/src/middleware/globalMiddleware.ts" + "../out/sdk/wasp/server/_types/taggedEntities.ts" ], - "5ecfd79481386c7ba17747a6d786166c8a7f95e331462d15303e1abf7cd031b7" + "6df33c5f432a8931138b4605bc2f3d84ac1ec130cc6233edc258321ed7c8da48" ], [ [ "file", - "server/src/middleware/index.ts" + "../out/sdk/wasp/server/api/index.ts" ], - "e658719309f9375f389c5d8d416fc27f9c247049e61188b3e01df954bcec15a4" + "57fcd47ce2ee3ffdff22513f14ba023da0f47577bc3950d5f9ea7dc6e981d26d" ], [ [ "file", - "server/src/middleware/operations.ts" + "../out/sdk/wasp/server/auth/index.ts" ], - "64eeed927f46f6d6eba143023f25fb9ac4cd81d6b68c9a7067306ad28a3eda92" + "61745079707aa8a4134e140b5cf33d5c9977d997da924de606cf606871438455" ], [ [ "file", - "server/src/polyfill.ts" + "../out/sdk/wasp/server/config.ts" ], - "66d3dca514bdd01be402714d0dfe3836e76f612346dea57ee595ae4f3da915cf" + "5d933eb55d44f4c3c42df7e8387dbd4b8b02f47191e59ee50d59c08a1f86634e" ], [ [ "file", - "server/src/queries/MySpecialQuery.ts" + "../out/sdk/wasp/server/crud/index.ts" ], - "00fa7ce8dbb7bc3f581ab6f6400a69c54d5520f5cba64598419e471d3a01f7ef" + "7dda71528ee183839082ecfad97fb862b4ec2bced1d6539bec2d166387051442" ], [ [ "file", - "server/src/queries/types.ts" + "../out/sdk/wasp/server/crud/tasks.ts" ], - "31c22daa41ba232cb457a2c45a4acfae5ce20c34fb32a13821a506ddac62b0f1" + "828dca19bb70fe4e7859d9763d242bead6861e27a4d044ae0a53bb2885a0f329" ], [ [ "file", - "server/src/routes/apis/index.ts" + "../out/sdk/wasp/server/dbClient.ts" ], - "879cafb5d1a8d2dd58acff9254c44b8449060d68183c49d95f1a141806fc969e" + "c5f88f028ad62b4a2fd5d1206aa72165f74c6f46f96250512af6ae55a5354020" ], [ [ "file", - "server/src/routes/auth/index.js" + "../out/sdk/wasp/server/email/core/helpers.ts" ], - "9761e5af295928520748246d3be0ba4113655dbef3afb5c9123894627f3bee1a" + "40e68a17cc94f11a2de35530422b865c878a6b265a841e201dfb7eb001f79a25" ], [ [ "file", - "server/src/routes/auth/logout.ts" + "../out/sdk/wasp/server/email/core/index.ts" ], - "1324b110888548ab535d78a4c7614c996152e948144a873d0262fa0aeb7ab4dc" + "bb01f17d0383daa546d4fb5362f0da400576aa0580353c7158720a5aec82a872" ], [ [ "file", - "server/src/routes/auth/me.js" + "../out/sdk/wasp/server/email/core/providers/sendgrid.ts" ], - "9a9cb533bb94af63caf448f73a0d0fef8902c8f8d1af411bed2570a32da2fab9" + "81c0ab1719a98e24524d23a85c9a196f3c436934f9aa3aff7086e53eef74bf04" ], [ [ "file", - "server/src/routes/crud/index.ts" + "../out/sdk/wasp/server/email/core/types.ts" ], - "b66ff949dbdaa892a354f3a60dc59ce229323ef55fad38239f8b335ec1e71b8d" + "bbcf7a7d4d894923f92e08299cd14d5efee54f22fda5bb05fae1e4f71cc4800c" ], [ [ "file", - "server/src/routes/crud/tasks.ts" + "../out/sdk/wasp/server/email/index.ts" ], - "cb5a53c503c946083cc46b2500a4eab49b3bfa867d3bcc1cae50355c0796369c" + "4a6a3fe784fe9e4efd8ae5baf93b8c8da1d3eab7fc7adc7c3708d460d65b00ce" ], [ [ "file", - "server/src/routes/index.js" + "../out/sdk/wasp/server/index.ts" ], - "b589a916a4ded52b75af42e299a506cbeb4d56ce2e87bec29f211c3e33865049" + "51c3e0802764f72b88f6daaf148dba514ae817e233a40cc9b92ec91784f71f98" ], [ [ "file", - "server/src/routes/operations/MySpecialAction.js" + "../out/sdk/wasp/server/jobs/core/job.ts" ], - "6bda2fb808fcc69fedb8f69aa08ceea94c668abec42643e15f59a3c161854bbb" + "c10df70eb886d6cd132b8a0b4f619dc500bbd4ec3174ef156cdad41be8cce021" ], [ [ "file", - "server/src/routes/operations/MySpecialQuery.js" + "../out/sdk/wasp/server/jobs/core/pgBoss/index.ts" ], - "af52108997cac2f416819822a9b7d2615121270a1c5886b5df7e03ae5cf1fc09" + "ba33f9b0680dd2a6fdea55c2eb8f8163ad60f4ebbac8b459d5c1a2a708524bec" ], [ [ "file", - "server/src/routes/operations/index.js" + "../out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts" ], - "0cb1f33b2ddb9dbe6bb2640f899aa151b388e1799e97b28390af6404154f28c0" + "4c405b3cf98a4cea0ee906a46e4676ebe7ce08c1652c1b502403a93ebbbf943a" ], [ [ "file", - "server/src/server.ts" + "../out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts" ], - "7963a3e625deb86593258b01dd87c94cf4e2103dbda3a6ee82e672911dee09bc" + "5f38460e959430e59c2e8fb8fd0f57493ea420e316258277bf67e4ba30e16cd8" ], [ [ "file", - "server/src/types/index.ts" + "../out/sdk/wasp/server/jobs/core/pgBoss/types.ts" ], - "f7621082fc7d8467a0967eb0bd82ff7956052b766e9e82d50584b8de88e0d28a" + "302dc48a5f4a5eb264764134c9397d27a681d1ea003fb8ca24d281c40bc0e0dc" ], [ [ "file", - "server/src/universal/types.ts" + "../out/sdk/wasp/server/jobs/index.ts" ], - "8ef378c1447289104856ec1a92931fd1280c0f8d0a8463008674e93bd798b884" + "43d2504cf67a7001431e8b174c0c681c7a35b589948ff60921c205ad3db838ff" ], [ [ "file", - "server/src/universal/url.ts" + "../out/sdk/wasp/server/jobs/mySpecialJob.ts" ], - "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" + "e3ae9eef941de7e55ccee6ea13239cb727ddf82bfa96bc41b71954e8fe1d813e" ], [ [ "file", - "server/src/utils.ts" + "../out/sdk/wasp/server/jobs/returnHelloJob.ts" ], - "7d29cb34de86e6a0689655e4165aed9fe5b0f82f54e4194f002f7d5823c7cb18" + "0f341aa2be5e33738d87a73fd18b0c11c69c2be100250e7b8b0106283d31ff75" ], [ [ "file", - "server/tsconfig.json" + "../out/sdk/wasp/server/middleware/globalMiddleware.ts" ], - "51a60d6350537a9e0696674aae86b122a7dea2a4497d294fd4fd6bc47b7e9808" + "53f258be83ca6de653b6b645253ce573e3c177e88017eb2adb17f5d3cebb36c3" ], [ [ "file", - "web-app/.env" + "../out/sdk/wasp/server/middleware/index.ts" ], - "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + "e658719309f9375f389c5d8d416fc27f9c247049e61188b3e01df954bcec15a4" ], [ [ "file", - "web-app/.gitignore" + "../out/sdk/wasp/server/operations/actions/index.ts" ], - "d373417ea2a8844e3b7a1515aab123e90fbeb4b7225144d55d243d9f6f04f73a" + "9ce0ac735512fb6cd011a2b18d4ebe4cbe5059248053a61a43cf35ca87e02523" ], [ [ "file", - "web-app/.npmrc" + "../out/sdk/wasp/server/operations/actions/types.ts" ], - "7151cf397def0c2cb0ab65643701d27d335a72c90f775675b5f826bc7005818a" + "d8ca5d71475fc4e4548cb3d3249dba3ae36142252f8efa1852a77edb86779198" ], [ [ "file", - "web-app/README.md" + "../out/sdk/wasp/server/operations/index.ts" ], - "6af47b8c26fa9d30e9b774e6c38d3456a3b469c3101bffb186e2a1fb325a93f4" + "72070083cab99701723556b9922438cdd0c216a53f9e8356da4e4caf5875dc6a" ], [ [ "file", - "web-app/index.html" + "../out/sdk/wasp/server/operations/queries/index.ts" ], - "f1ca90861003c568c2670b0064f15431cfc45a68b23ffd890b1187af588a76d9" + "1e02dec4a438644acac0d45a93f9dcef63f4a0545311d920c518a06d7452ea50" ], [ [ "file", - "web-app/netlify.toml" + "../out/sdk/wasp/server/operations/queries/types.ts" ], - "854009c7d1b2630a55099439f89e4947188ea4160c9d1388b46b5a5cf6ab461a" + "26d0b0bad652d9a51af568f95e361e45860181ad2816a8f1d3113fdf2fdd3c6e" ], [ [ "file", - "web-app/package.json" + "../out/sdk/wasp/server/types/index.ts" ], - "f782dbe1d5f6abae8ed14f18d8b727193360c7ea48756cf8f02ac2a0fdfc4895" + "0f2ffdfdd76c92084bd0ba270b674628ec907da0d047de6c8a9912e415462d97" ], [ [ "file", - "web-app/public/favicon.ico" + "../out/sdk/wasp/server/utils.ts" ], - "1481f03584b46b63182c1f8d26e61a95ce4d8fae032b2b4f3fe5e00ab7e96c23" + "fb02a9482c7bfe388b6140bd6be95d6ab97f69ec5458c59055ab3d7b91893309" ], [ [ "file", - "web-app/public/manifest.json" + "../out/sdk/wasp/tsconfig.json" ], - "b57981d1636058192ae6057166991125031f519f24c0a0711ef16dc73958e51a" + "5a1d45e247132b9afbfabb9073749a924a86bfefe945a954c1f44ec672e1fef3" ], [ [ "file", - "web-app/scripts/universal/validators.mjs" + "../out/sdk/wasp/universal/types.ts" ], - "94edf3906c43fb476b22244d07a5d69fd6c967de767532ed5b3215e2a6eee91b" + "8ef378c1447289104856ec1a92931fd1280c0f8d0a8463008674e93bd798b884" ], [ [ "file", - "web-app/scripts/validate-env.mjs" + "../out/sdk/wasp/universal/url.ts" ], - "690460410bc9b28a8e96c6e20902e841f07b77faccf3db7e7249f48f700f4bab" + "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" ], [ [ "file", - "web-app/src/actions/MySpecialAction.ts" + "../out/sdk/wasp/universal/validators.ts" ], - "32410f3702d0f04f19b6c6f84f827dc208eb63b7dce062385e388601ddfc72cf" + "80c624ff5caa11fcaa66c74eb3a473dbedc9bbac3ece740361d7752f5f45d38f" ], [ [ "file", - "web-app/src/actions/core.d.ts" + "../out/sdk/wasp/vite-env.d.ts" ], - "34b44699906b98ca28050479b66254e64073a403b571a8fd1a227395d27becae" + "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5" ], [ [ "file", - "web-app/src/actions/core.js" + ".dockerignore" ], - "f38003d51d9754952bf595a25fdb44580d88af3bcd6658848cf8a339a8240689" + "a2a5ebe3785244437c0d490b4bfa1652c84b9ab0d4f25566fd7e69d1421d7a1b" ], [ [ "file", - "web-app/src/actions/index.ts" + "Dockerfile" ], - "607c3311861456ae47c246a950c8e29593f9837a9f5c48923d99cd7fac1ce0bb" + "782bbb77a9342451751614eead1ee402aa37376d60d19e8ea4cc4635686de95d" ], [ [ "file", - "web-app/src/api.ts" + "db/schema.prisma" ], - "850331885230117aa56317186c6d38f696fb1fbd0c56470ff7c6e4f3c1c43104" + "196026a80ee5430c1a4e01746f66d46d44ce21464cc8f580e0995d19034530d7" ], [ [ "file", - "web-app/src/api/events.ts" + "server/.env" ], - "91ec1889f649b608ca81cab8f048538b9dcc70f49444430b1e5b572af2a4970a" + "d9649485a674ce3c6b8d668a1253cde3bd8695cb3d2d3a6b7c573a3e2805c7ec" ], [ [ "file", - "web-app/src/auth/forms/Auth.tsx" + "server/.gitignore" ], - "fc6c204f73999f556eab441772e66dd4dbd433bd69aa2c9e64e713fb2921a886" + "2c3d81dd719ff91d51609a02d03ba62ad456e2c50763b7b4c761395cb583f890" ], [ [ "file", - "web-app/src/auth/forms/Login.tsx" + "server/.npmrc" ], - "17f42b2faa70876fb680de43ef33b5caa6c310c254af07358e21bc710f9214a9" + "8a74b1091affea3c71c2cf04acbaa38c4a51a261a9a98dcc9e96473d07a85a27" ], [ [ "file", - "web-app/src/auth/forms/Signup.tsx" + "server/README.md" ], - "a38124a9a250a603ef6d04dbcb46c04084ace676e9de5fc31f229405d87f47d4" + "e14514b8b152dd2160a217d8fc66a710c8607c4ed1441a2148a0770701818249" ], [ [ "file", - "web-app/src/auth/forms/internal/Form.tsx" + "server/nodemon.json" ], - "b9b21954b919f173b751c0078aed8303cc15d88df9e9874228efcae7976f26cd" + "6cb3f8539e5cf59e29e3c97c9b4fa405600ea132784e4f47f79555951f47bd38" ], [ [ "file", - "web-app/src/auth/forms/internal/Message.tsx" + "server/package.json" ], - "01f10e2499dfd2b88f6a3a9109153f121fad59614acfc7346f40fc51df96bdaf" + "91cc00be5e83a3f199677e64b811993a2b0e36a37d4ad4a2f30c43c0f806c9a7" ], [ [ "file", - "web-app/src/auth/forms/internal/common/LoginSignupForm.tsx" + "server/rollup.config.js" ], - "c44ab5ffb4e71ead2acd45b17786fe305db856b698c01b1112d140ee5bfe4d31" + "c1beb8264f11898364288d73b16f08d1923bac5f70038d9827978deb5b58a2da" ], [ [ "file", - "web-app/src/auth/forms/internal/social/SocialButton.tsx" + "server/scripts/validate-env.mjs" ], - "4ece421ad263727e914e26042f262b7abc3dcc52a9bad83d6476e1eb76c70a67" + "65168a764fc6cbe785ee40a8e8533b4694ef9019fc5a73f60f7252152330d0a2" ], [ [ "file", - "web-app/src/auth/forms/internal/social/SocialIcons.tsx" + "server/src/actions/mySpecialAction.ts" ], - "bd52b9c07dfdd1e061e68c80b7a29ecfce5bd340a8da1b9163edbbf67a649354" + "d306e32442616e08a6a2bbf4fce881a983d5db12b6de648313a83e362dcc552a" ], [ [ "file", - "web-app/src/auth/forms/types.ts" + "server/src/actions/types.ts" ], - "992ca4b2c8e30536636143c556e6bdcc5d5d0d86c1eb2e119171e25d5c33b4e3" + "a589183e85ac3cf0dca3011e3cdf1d59e28b03cc38b3fb6e4e57008ac1c8d66b" ], [ [ "file", - "web-app/src/auth/helpers/Google.jsx" + "server/src/app.js" ], - "dd4daa37a618852db5da6ba5a718541f99ce57ceaaca3c397ba4e4c3739fdde8" + "a10bb6f3daab886b0685994368711fd7718a2a3e50a9329cd7da6394b9c59302" ], [ [ "file", - "web-app/src/auth/helpers/user.ts" + "server/src/auth/providers/config/google.ts" ], - "e57cecd0a50b1515d6da8fcfb45f1e98ebefa4f58fe59d792100ffd40980fee9" + "6b82ea1a7779db285649a0f80e5199acb93617025de04492b2bb0357cc5b5e69" ], [ [ "file", - "web-app/src/auth/logout.ts" + "server/src/auth/providers/index.ts" ], - "e04607e4676af958f580152432e873452a33a4276ecdb1a4c368efe2e3958a6c" + "2965a704a128cdde97428d59b4839244087c56c63ff63dfc5cd4b130c3f4e4c7" ], [ [ "file", - "web-app/src/auth/pages/OAuthCodeExchange.jsx" + "server/src/auth/providers/oauth/createRouter.ts" ], - "1536a0abfd92944dca315e344758ba50f44a18e34c18a8c1c91046b1e4cc2a5e" + "a117a9b61d0e647707d4dc2cd4f8746784d6d5d005ca0cc4fc2502fcf0aa416b" ], [ [ "file", - "web-app/src/auth/pages/createAuthRequiredPage.jsx" + "server/src/auth/providers/oauth/init.ts" ], - "eb3eced8b273e539f1f0d06a4f99194237e414d208136ac5ac3da6e3c52c2566" + "a7c95d63cea8842f5e2bc541080f38d5b19aacbc79f9dadb787376cba276108d" ], [ [ "file", - "web-app/src/auth/types.ts" + "server/src/auth/providers/oauth/types.ts" ], - "26b1d53d6ea48d56421ee7050486eb9086367195534f21ca3371cd0685307d7c" + "26cd322bd83ee8d6569fac1e3db47b2d07292f40ff3a8a501a363a3338d243b3" ], [ [ "file", - "web-app/src/auth/useAuth.ts" + "server/src/crud/tasks.ts" ], - "f730cb58a5ebd12285b7568bec34f4e5615261580cff1727e64b5c871d784d62" + "9c1fd4851be88c0e3664d571959f47b1817968bbee769c54c37356756232a07a" ], [ [ "file", - "web-app/src/auth/user.ts" + "server/src/jobs/core/allJobs.ts" ], - "08cd2cf7dbb5aa5371efcfc1b16651c0c59d03d4ea36cd9f69bdaa9edc5ca68e" + "a695a5c536c62a664596ebce677e0a54f9547b540479090df6cc6ebc4ad15962" ], [ [ "file", - "web-app/src/config.js" + "server/src/jobs/mySpecialJob.ts" ], - "b06175129dd8be8ca6c307fafa02646d47233c4e26fdfeea6d7802d02e9513f3" + "a93521d6cb34ea3e5b22fea6b8adaf2e00919f2f9460f189ef3b046a87f8c4b0" ], [ [ "file", - "web-app/src/crud/tasks.ts" + "server/src/jobs/returnHelloJob.ts" ], - "2f4ca60123e3fe999dbe4814182b7d09d0039db120e5c260ccc824806561b5e7" + "fe85a8bbe6e789563b13952bb7fd54934e7e955682688b2126a6dced2cda4893" ], [ [ "file", - "web-app/src/entities/index.ts" + "server/src/middleware/globalMiddleware.ts" ], - "f3daa2f99b1ead27d95ef05fbd493c26b697a4c6d413432a1959d41e4cb205a2" + "312850493f4b17b42d5878b1c41be7db66e11bf5cf1997f9506cb06ee05ab5bd" ], [ [ "file", - "web-app/src/ext-src/App.jsx" + "server/src/middleware/index.ts" ], - "b23058c8652ddb88b8e147e20fb97c7e90c076b5224314f6a3ab4c620957c0ae" + "e658719309f9375f389c5d8d416fc27f9c247049e61188b3e01df954bcec15a4" ], [ [ "file", - "web-app/src/ext-src/Main.css" + "server/src/middleware/operations.ts" ], - "1583ce49887ea575e563dab0c7ad6d2e2e3e6a351ed7c2f80c310641b1456417" + "de21cabd75600314b3b59f4110f27eb5411444ffe26926f2dfaf043932185cae" ], [ [ "file", - "web-app/src/ext-src/MainPage.jsx" + "server/src/polyfill.ts" ], - "8ee7fe1352719facadf0935eb45df8661ba13015277ea80be5a9200c66a31bde" + "66d3dca514bdd01be402714d0dfe3836e76f612346dea57ee595ae4f3da915cf" ], [ [ "file", - "web-app/src/ext-src/myClientSetupCode.js" + "server/src/queries/mySpecialQuery.ts" ], - "32219bbb2a8d08dfa8447255b922c9d0d202d21a38e2fbc281b62b181b6f5134" + "4f907aed444b1778b919bb2021a44a53f2282d238e65e843670d2e786a623a71" ], [ [ "file", - "web-app/src/ext-src/vite-env.d.ts" + "server/src/queries/types.ts" ], - "d677883c270ee71acc9bfd95c824650b541036599427a8ffc0ad33323d08e61d" + "66c2b2bc17cf6042948123ee3995c07cad5d92e61394596a3a817a497d469c97" ], [ [ "file", - "web-app/src/ext-src/vite.config.ts" + "server/src/routes/apis/index.ts" ], - "797dfb8022557b5ce5ce856daca01911974497f9ccf656f5920e5b42a986f4f8" + "7928725e710e9b7d23ad81ed8d704b314e72fcd731cb17e854ec593ee51f89f5" ], [ [ "file", - "web-app/src/ext-src/waspLogo.png" + "server/src/routes/auth/index.js" ], - "0f05a89eb945d6d7326110e88776e402833b356202b06d0a8bf652e118d3fd2f" + "9e57345816199759a42c4d8b37b8621eee587820e679e46278d12204d0cb130a" ], [ [ "file", - "web-app/src/index.tsx" + "server/src/routes/auth/logout.ts" ], - "db4c0dd228be7d2dad2ad92b03719b9c0508196a9ced4dfef8f1690c154669e3" + "76d35d8c93a580cdbcd51cf2030176865648d25ee25eaa8c00fa31ea0669bf81" ], [ [ "file", - "web-app/src/logo.png" + "server/src/routes/auth/me.js" ], - "35f14abf46cb0e9d9b4e3d11961917eecb86be65a0d7f4e6bc9713c5766b5f1b" + "aad9eb2527d58a3d8226ed7ae6c15a09eac7bbb74c58816d01b38fc0a67e2c08" ], [ [ "file", - "web-app/src/operations/index.ts" + "server/src/routes/crud/index.ts" ], - "7ec3870a9313ec17d2282f9002da4a5d4da3c096c5fb0927acd008f1bec60bb3" + "b66ff949dbdaa892a354f3a60dc59ce229323ef55fad38239f8b335ec1e71b8d" ], [ [ "file", - "web-app/src/operations/resources.js" + "server/src/routes/crud/tasks.ts" ], - "c08445d84f9931ebc3e4f975017bf88c03b6bee9aa588e945d52fe3aee9c4d70" + "285bd11bbc60daa99d185b6713e91ad93d0c2fdcefb26f8ab8abbf6e0f28cce4" ], [ [ "file", - "web-app/src/operations/updateHandlersMap.js" + "server/src/routes/index.js" ], - "07a9933a771853585fd2fc49c3dcb9f1cad947acb2168580c835fae25620fa9f" + "b589a916a4ded52b75af42e299a506cbeb4d56ce2e87bec29f211c3e33865049" ], [ [ "file", - "web-app/src/queries/MySpecialQuery.ts" + "server/src/routes/operations/index.js" ], - "2d1424a21683c9c6a2facbd60ede45a90bc7b4deb04b04c8e0d955a140eb3d9d" + "2ff9557be1b10bdfae6f0f1678d61321ce3add46a7a107e27b80aeb4db7da9da" ], [ [ "file", - "web-app/src/queries/core.d.ts" + "server/src/routes/operations/mySpecialAction.js" ], - "8ac475ed46a373ddc47e37dd557315c9c15abcde527749bb40c08527130e0567" + "95651065db7a7777d0c0915deca6db2d25d65be43b3eaa60c332cd949d3759cf" ], [ [ "file", - "web-app/src/queries/core.js" + "server/src/routes/operations/mySpecialQuery.js" ], - "3ac4a8402a7d6af3eb4a90ec59bcfdd32585f3f2dc6d6bed8a1140cea8fdb7f2" + "b22536cfdb870b96df0c17d36282390fd3acba673cdae2f7b1e2b0464a4eed9b" ], [ [ "file", - "web-app/src/queries/index.d.ts" + "server/src/server.ts" ], - "f3a7cf037867cd7f8ce76cbca5e5eb2aacb9ca69933c182bce2f7ff935c4d385" + "fd4a9cd212e14caefc41e916bc816594cd8b76a2565adfd5495c01a6bf5aa936" ], [ [ "file", - "web-app/src/queries/index.js" + "server/tsconfig.json" ], - "8379699fa710f43d5be2b96f3a5c7c551a8d3d9db3ef0fea964502da00f36ffc" + "ae9b0031fd08188a5fa7ab0a0994dfe9bdbd1d8f2e1ba2df4f609b9b470eb6b4" ], [ [ "file", - "web-app/src/queryClient.js" + "web-app/.env" ], - "1739d8618286b4a2aa536bd3fcb754514c828ec896b69c7074e22f66c07e7b03" + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ], [ [ "file", - "web-app/src/router.tsx" + "web-app/.gitignore" ], - "16209b667488c40c3a7a80be224d6d1ebb8df75bbaf8f2c6398eff07a92618ca" + "d373417ea2a8844e3b7a1515aab123e90fbeb4b7225144d55d243d9f6f04f73a" ], [ [ "file", - "web-app/src/router/Link.tsx" + "web-app/.npmrc" ], - "7b6214295d59d8dffbd61b82f9dab2b080b2d7ebe98cc7d9f9e8c229f99a890d" + "7151cf397def0c2cb0ab65643701d27d335a72c90f775675b5f826bc7005818a" ], [ [ "file", - "web-app/src/router/linkHelpers.ts" + "web-app/README.md" ], - "c296ed5e7924ad1173f4f0fb4dcce053cffd5812612069b5f62d1bf9e96495cf" + "6af47b8c26fa9d30e9b774e6c38d3456a3b469c3101bffb186e2a1fb325a93f4" ], [ [ "file", - "web-app/src/router/types.ts" + "web-app/index.html" ], - "7f08b262987c17f953c4b95814631a7aaac82eb77660bcb247ef7bf866846fe1" + "f1ca90861003c568c2670b0064f15431cfc45a68b23ffd890b1187af588a76d9" ], [ [ "file", - "web-app/src/stitches.config.js" + "web-app/netlify.toml" ], - "f238234a9db89d6a34c7a8c7c948a58c011da8e167ff94d72e7c6808beb4e177" + "854009c7d1b2630a55099439f89e4947188ea4160c9d1388b46b5a5cf6ab461a" ], [ [ "file", - "web-app/src/storage.ts" + "web-app/package.json" ], - "e9e2a4a02d48bea1597fcdc00592e3d975eea7fa6e0545cf087da9429c5f4979" + "1b0855b401aae4ceb6eca959600a1fde84e9f7590beb8362a7d2fad40bcb6fef" ], [ [ "file", - "web-app/src/test/index.ts" + "web-app/public/.gitkeep" ], - "cb2e2dc33df8afc0d4453f4322a4e2af92f3345e9622e0416fa87e34d6acb9d8" + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ], [ [ "file", - "web-app/src/test/vitest/helpers.tsx" + "web-app/public/favicon.ico" ], - "a38e55c9999a87ab497538bcad7c880f32a4d27f2227ae326cb76eb0848b89e9" + "1481f03584b46b63182c1f8d26e61a95ce4d8fae032b2b4f3fe5e00ab7e96c23" ], [ [ "file", - "web-app/src/test/vitest/setup.ts" + "web-app/public/manifest.json" ], - "1c08b10e428cec3939e0ab269c9a02694e196de7c5dd9f18372424bdccbc5028" + "b57981d1636058192ae6057166991125031f519f24c0a0711ef16dc73958e51a" ], [ [ "file", - "web-app/src/types.ts" + "web-app/scripts/validate-env.mjs" ], - "282f6bdef1e7e8846ad53909bbf88c54cd04a0594b77b1e87cb69266de84cc6d" + "a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd" ], [ [ "file", - "web-app/src/universal/types.ts" + "web-app/src/auth/pages/OAuthCodeExchange.jsx" ], - "8ef378c1447289104856ec1a92931fd1280c0f8d0a8463008674e93bd798b884" + "e4d576893ad5d010e648a15ee2fed41b3c81a3fea2509ca36e8a0eb50dad57f6" ], [ [ "file", - "web-app/src/universal/url.ts" + "web-app/src/auth/pages/createAuthRequiredPage.jsx" ], - "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" + "04ca0c6aa20114998fb60080474026d80b9efbb7fc3cbe29f86a5ecab2300b05" + ], + [ + [ + "file", + "web-app/src/entities/index.ts" + ], + "f3daa2f99b1ead27d95ef05fbd493c26b697a4c6d413432a1959d41e4cb205a2" + ], + [ + [ + "file", + "web-app/src/index.tsx" + ], + "46b4cde819de4048b82feb249ae662fb60de2297c6a740f49da239011848458d" + ], + [ + [ + "file", + "web-app/src/logo.png" + ], + "35f14abf46cb0e9d9b4e3d11961917eecb86be65a0d7f4e6bc9713c5766b5f1b" + ], + [ + [ + "file", + "web-app/src/queryClient.js" + ], + "1739d8618286b4a2aa536bd3fcb754514c828ec896b69c7074e22f66c07e7b03" + ], + [ + [ + "file", + "web-app/src/router.tsx" + ], + "c94602fdeda55855e2c869596d266163f9786e6841b33e4a346b8d4f527c6c30" + ], + [ + [ + "file", + "web-app/src/test/vitest/setup.ts" + ], + "610e936776aaa39e861f0b2a83b0c0290d74ca8123d9d5409e5f2183384fdb52" ], [ [ @@ -1047,7 +1187,7 @@ "file", "web-app/tsconfig.json" ], - "f1b31ca75b2b32c5b0441aec4fcd7f285c18346761ba1640761d6253d65e3580" + "dfeee6d883ed2504c149c64b24ca939c0ad4812b78bfdced7293a386a008effd" ], [ [ @@ -1061,6 +1201,6 @@ "file", "web-app/vite.config.ts" ], - "08962d79f2d71eb470ee85dee03db6deca7ede28df9d41542bbaea752db0eeed" + "64256d93d81f6192f419e836ed4484f0e8c1e28f018bfb3213851608200594ac" ] ] \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/Dockerfile b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/Dockerfile index 43fe65d7ef..33b4765557 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/Dockerfile +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/Dockerfile @@ -2,7 +2,7 @@ # Because if not, we had situations where it would use the different version # locally and on Github CI. This way we ensure exact version is used, # and also have control over updating it (instead of update surprising us). -FROM node:18-alpine3.17 AS node +FROM node:18.18.0-alpine3.17 AS node # We split Dockerfile into base, server-builder and server-production. @@ -17,16 +17,29 @@ FROM node AS base RUN apk --no-cache -U upgrade # To ensure any potential security patches are applied. +# Todo: The 'server-builder' image stays on disk under : and is +# relatively large (~900 MB), should we remove it? Or is it useful for future +# builds? FROM base AS server-builder -RUN apk add --no-cache build-base libtool autoconf automake +# Building the Docker image on Apple's Silicon Mac fails without python3 (the build +# throws `node-gyp` errors when it tries to compile native deps. Installing +# `python3` fixes the issue. +RUN apk add --no-cache python3 build-base libtool autoconf automake WORKDIR /app -COPY server/ ./server/ +# Since the framwork code in /.wasp/build/server imports the user code in /src +# using relative imports, we must mirror the same directory structure in the +# Docker image. +COPY src ./src +COPY package.json . +COPY package-lock.json . +COPY .wasp/build/server .wasp/build/server +COPY .wasp/out/sdk .wasp/out/sdk # Install npm packages, resulting in node_modules/. -RUN cd server && npm install -COPY db/schema.prisma ./db/ -RUN cd server && PRISMA_CLIENT_OUTPUT_DIR=../server/node_modules/.prisma/client/ npx prisma generate --schema='../db/schema.prisma' +RUN npm install && cd .wasp/build/server && npm install +COPY .wasp/build/db/schema.prisma .wasp/build/db/ +RUN cd .wasp/build/server && npx prisma generate --schema='../db/schema.prisma' # Building the server should come after Prisma generation. -RUN cd server && npm run build +RUN cd .wasp/build/server && npm run bundle # TODO: Use pm2? @@ -36,13 +49,21 @@ FROM base AS server-production RUN apk add --no-cache python3 ENV NODE_ENV production WORKDIR /app -COPY --from=server-builder /app/server/node_modules ./server/node_modules -COPY --from=server-builder /app/server/dist ./server/dist -COPY --from=server-builder /app/server/package*.json ./server/ -COPY --from=server-builder /app/server/scripts ./server/scripts -COPY db/ ./db/ +# Copying the top level 'node_modules' because it contains the Prisma packages +# necessary for migrating the database. +COPY --from=server-builder /app/node_modules ./node_modules +# Copying the SDK because 'validate-env.mjs' executes independent of the bundle +# and references the 'wasp' package. +COPY --from=server-builder /app/.wasp/out/sdk .wasp/out/sdk +# Copying 'server/node_modules' because 'validate-env.mjs' executes independent +# of the bundle and references the dotenv package. +COPY --from=server-builder /app/.wasp/build/server/node_modules .wasp/build/server/node_modules +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/ EXPOSE ${PORT} -WORKDIR /app/server +WORKDIR /app/.wasp/build/server ENTRYPOINT ["npm", "run", "start-production"] diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/db/package.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/db/package.json deleted file mode 100644 index c418219d3b..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/db/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "dependencies": { - "@prisma/client": "^4.16.2" - }, - "devDependencies": { - "prisma": "^4.16.2" - } -} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/db/schema.prisma b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/db/schema.prisma index ea120405ad..598fb4270d 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/db/schema.prisma +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/db/schema.prisma @@ -6,7 +6,6 @@ datasource db { generator client { provider = "prisma-client-js" - output = env("PRISMA_CLIENT_OUTPUT_DIR") } model User { diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/db/schema.prisma.wasp-generate-checksum b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/db/schema.prisma.wasp-generate-checksum index a654c68c7b..717e139d94 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/db/schema.prisma.wasp-generate-checksum +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/db/schema.prisma.wasp-generate-checksum @@ -1 +1 @@ -5a41561cd6f853da2f4b9f64267f5d4e3b2865f94dfa92d9143acf2c1485519c \ No newline at end of file +196026a80ee5430c1a4e01746f66d46d44ce21464cc8f580e0995d19034530d7 \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/installedFullStackNpmDependencies.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/installedFullStackNpmDependencies.json deleted file mode 100644 index 24e5342120..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/installedFullStackNpmDependencies.json +++ /dev/null @@ -1 +0,0 @@ -{"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"express","version":"~4.18.1"},{"name":"morgan","version":"~1.10.0"},{"name":"@prisma/client","version":"4.16.2"},{"name":"jsonwebtoken","version":"^8.5.1"},{"name":"secure-password","version":"^4.0.0"},{"name":"dotenv","version":"16.0.2"},{"name":"helmet","version":"^6.0.0"},{"name":"patch-package","version":"^6.4.7"},{"name":"uuid","version":"^9.0.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"},{"name":"lucia","version":"^3.0.0-beta.14"},{"name":"@lucia-auth/adapter-prisma","version":"^4.0.0-beta.9"},{"name":"passport","version":"0.6.0"},{"name":"passport-google-oauth20","version":"2.0.0"},{"name":"pg-boss","version":"^8.4.2"},{"name":"@sendgrid/mail","version":"^7.7.0"},{"name":"react-redux","version":"^7.1.3"},{"name":"redux","version":"^4.0.5"}],"devDependencies":[{"name":"nodemon","version":"^2.0.19"},{"name":"standard","version":"^17.0.0"},{"name":"prisma","version":"4.16.2"},{"name":"typescript","version":"^5.1.0"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/uuid","version":"^9.0.0"},{"name":"@types/cors","version":"^2.8.5"}]},"npmDepsForWebApp":{"dependencies":[{"name":"axios","version":"^1.4.0"},{"name":"react","version":"^18.2.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"@prisma/client","version":"4.16.2"},{"name":"superjson","version":"^1.12.2"},{"name":"mitt","version":"3.0.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"@stitches/react","version":"^1.2.8"},{"name":"react-redux","version":"^7.1.3"},{"name":"redux","version":"^4.0.5"}],"devDependencies":[{"name":"vite","version":"^4.3.9"},{"name":"typescript","version":"^5.1.0"},{"name":"@types/react","version":"^18.0.37"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react-swc","version":"^3.0.0"},{"name":"dotenv","version":"^16.0.3"},{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"vitest","version":"^0.29.3"},{"name":"@vitest/ui","version":"^0.29.3"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.0.0"},{"name":"@testing-library/jest-dom","version":"^5.16.5"},{"name":"msw","version":"^1.1.0"}]}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/installedNpmDepsLog.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/installedNpmDepsLog.json new file mode 100644 index 0000000000..18becf3c53 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/installedNpmDepsLog.json @@ -0,0 +1 @@ +{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"4.16.2"},{"name":"prisma","version":"4.16.2"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"jsonwebtoken","version":"^8.5.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"secure-password","version":"^4.0.0"},{"name":"sodium-native","version":"3.3.0"},{"name":"superjson","version":"^1.12.2"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@stitches/react","version":"^1.2.8"},{"name":"lucia","version":"^3.0.0-beta.14"},{"name":"@lucia-auth/adapter-prisma","version":"^4.0.0-beta.9"},{"name":"@sendgrid/mail","version":"^7.7.0"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"},{"name":"pg-boss","version":"^8.4.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"4.16.2"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"jsonwebtoken","version":"^8.5.1"},{"name":"morgan","version":"~1.10.0"},{"name":"passport","version":"0.6.0"},{"name":"passport-google-oauth20","version":"2.0.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"secure-password","version":"^4.0.0"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/api/events.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/api/events.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/api/events.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/api/events.ts diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/api.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/api/index.ts similarity index 92% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/api.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/api/index.ts index 17e36c1248..d066bd5448 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/api.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/api/index.ts @@ -1,10 +1,11 @@ import axios, { type AxiosError } from 'axios' -import config from './config' -import { storage } from './storage' -import { apiEventsEmitter } from './api/events' +import config from 'wasp/core/config' +import { storage } from 'wasp/core/storage' +import { apiEventsEmitter } from './events.js' -const api = axios.create({ +// PUBLIC API +export const api = axios.create({ baseURL: config.apiUrl, }) @@ -12,22 +13,26 @@ 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() @@ -66,6 +71,7 @@ window.addEventListener('storage', (event) => { } }) +// 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 @@ -100,5 +106,3 @@ class WaspHttpError extends Error { this.data = data } } - -export default api diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/Auth.tsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/Auth.tsx similarity index 96% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/Auth.tsx rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/Auth.tsx index 95a337f439..99c8f98731 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/Auth.tsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/Auth.tsx @@ -1,6 +1,6 @@ import { useState, createContext } from 'react' import { createTheme } from '@stitches/react' -import { styled } from '../../stitches.config' +import { styled } from 'wasp/core/stitches.config' import { type State, @@ -27,6 +27,7 @@ const HeaderText = styled('h2', { }) +// PRIVATE API export const AuthContext = createContext({ isLoading: false, setIsLoading: (isLoading: boolean) => {}, @@ -82,4 +83,5 @@ function Auth ({ state, appearance, logo, socialLayout = 'horizontal', additiona ) } +// PRIVATE API export default Auth; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/Login.tsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/Login.tsx similarity index 95% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/Login.tsx rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/Login.tsx index 2ea532d9c5..f8fca66082 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/Login.tsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/Login.tsx @@ -1,6 +1,7 @@ import Auth from './Auth' import { type CustomizationOptions, State } from './types' +// PUBLIC API export function LoginForm({ appearance, logo, diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/Signup.tsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/Signup.tsx similarity index 97% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/Signup.tsx rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/Signup.tsx index 66ffab4503..32c7afc38a 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/Signup.tsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/Signup.tsx @@ -5,6 +5,7 @@ import { State, } from './types' +// PUBLIC API export function SignupForm({ appearance, logo, diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/Form.tsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/Form.tsx similarity index 93% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/Form.tsx rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/Form.tsx index 24d6c586d0..1634307427 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/Form.tsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/Form.tsx @@ -1,15 +1,18 @@ -import { styled } from '../../../stitches.config' +import { styled } from 'wasp/core/stitches.config' +// PRIVATE API export const Form = styled('form', { marginTop: '1.5rem', }) +// PUBLIC API export const FormItemGroup = styled('div', { '& + div': { marginTop: '1.5rem', }, }) +// PUBLIC API export const FormLabel = styled('label', { display: 'block', fontSize: '$sm', @@ -48,10 +51,13 @@ const commonInputStyles = { margin: 0, } +// PUBLIC API export const FormInput = styled('input', commonInputStyles) +// PUBLIC API export const FormTextarea = styled('textarea', commonInputStyles) +// PUBLIC API export const FormError = styled('div', { display: 'block', fontSize: '$sm', @@ -60,6 +66,7 @@ export const FormError = styled('div', { marginTop: '0.5rem', }) +// PRIVATE API export const SubmitButton = styled('button', { display: 'flex', justifyContent: 'center', diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/Message.tsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/Message.tsx similarity index 79% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/Message.tsx rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/Message.tsx index 3a38c1cd96..362ff9dfda 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/Message.tsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/Message.tsx @@ -1,5 +1,6 @@ -import { styled } from '../../../stitches.config' +import { styled } from 'wasp/core/stitches.config' +// PRIVATE API export const Message = styled('div', { padding: '0.5rem 0.75rem', borderRadius: '0.375rem', @@ -7,11 +8,13 @@ export const Message = styled('div', { background: '$gray400', }) +// PRIVATE API export const MessageError = styled(Message, { background: '$errorBackground', color: '$errorText', }) +// PRIVATE API export const MessageSuccess = styled(Message, { background: '$successBackground', color: '$successText', diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/common/LoginSignupForm.tsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx similarity index 97% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/common/LoginSignupForm.tsx rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx index f03039f0f3..db1dcb89c9 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/common/LoginSignupForm.tsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx @@ -1,7 +1,7 @@ import { useContext } from 'react' import { useForm, UseFormReturn } from 'react-hook-form' -import { styled } from '../../../../stitches.config' -import config from '../../../../config' +import { styled } from 'wasp/core/stitches.config' +import config from 'wasp/core/config' import { AuthContext } from '../../Auth' import { @@ -61,10 +61,12 @@ const SocialAuthButtons = styled('div', { }) const googleSignInUrl = `${config.apiUrl}/auth/google/login` +// PRIVATE API export type LoginSignupFormFields = { [key: string]: string; } +// PRIVATE API export const LoginSignupForm = ({ state, socialButtonsDirection = 'horizontal', diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/social/SocialButton.tsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/social/SocialButton.tsx similarity index 90% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/social/SocialButton.tsx rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/social/SocialButton.tsx index 79284d0354..cd2cf48853 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/social/SocialButton.tsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/social/SocialButton.tsx @@ -1,5 +1,6 @@ -import { styled } from '../../../../stitches.config' +import { styled } from 'wasp/core/stitches.config' +// PRIVATE API export const SocialButton = styled('a', { display: 'flex', justifyContent: 'center', diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/social/SocialIcons.tsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/social/SocialIcons.tsx similarity index 98% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/social/SocialIcons.tsx rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/social/SocialIcons.tsx index aac1f53ff1..7192e457b1 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/forms/internal/social/SocialIcons.tsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/social/SocialIcons.tsx @@ -5,6 +5,7 @@ const defaultStyles = css({ height: '1.25rem', }) +// PRIVATE API export const Google = () => ( ( ) +// PRIVATE API export const GitHub = () => ( [0] } +// PRIVATE API export type ErrorMessage = { title: string description?: string } +// PRIVATE API export type FormState = { isLoading: boolean } +// PRIVATE API export type AdditionalSignupFieldRenderFn = ( hookForm: UseFormReturn, formState: FormState ) => React.ReactNode +// PRIVATE API export type AdditionalSignupField = { name: string label: string @@ -34,6 +40,7 @@ export type AdditionalSignupField = { validations?: RegisterOptions } +// PRIVATE API export type AdditionalSignupFields = | (AdditionalSignupField | AdditionalSignupFieldRenderFn)[] | AdditionalSignupFieldRenderFn diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/helpers/Google.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/helpers/Google.tsx similarity index 83% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/helpers/Google.jsx rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/helpers/Google.tsx index ef8a3895e6..f9938eda97 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/helpers/Google.jsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/helpers/Google.tsx @@ -1,10 +1,12 @@ -import config from '../../config.js' +import config from 'wasp/core/config' import { SocialButton } from '../forms/internal/social/SocialButton' import * as SocialIcons from '../forms/internal/social/SocialIcons' +// PUBLIC API export const signInUrl = `${config.apiUrl}/auth/google/login` +// PUBLIC API export function SignInButton() { return ( diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/helpers/user.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/helpers/user.ts similarity index 78% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/helpers/user.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/helpers/user.ts index a6b06299ce..d5e99a7e40 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/helpers/user.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/helpers/user.ts @@ -1,6 +1,7 @@ -import { setSessionId } from '../../api' -import { invalidateAndRemoveQueries } from '../../operations/resources' +import { setSessionId } from 'wasp/client/api' +import { invalidateAndRemoveQueries } from '../../client/operations/internal/resources.js' +// PRIVATE API export async function initSession(sessionId: string): Promise { setSessionId(sessionId) // We need to invalidate queries after login in order to get the correct user diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/index.ts new file mode 100644 index 0000000000..4b79c6ad5e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/index.ts @@ -0,0 +1,4 @@ +// PUBLIC +export type { AuthUser } from '../server/_types' + +export { getEmail, getUsername, getFirstProviderUserId, findUserIdentity } from './user.js' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/jwt.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/jwt.ts similarity index 82% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/jwt.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/jwt.ts index 5d2f4ae6fa..8ed702e4c0 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/jwt.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/jwt.ts @@ -1,12 +1,14 @@ import jwt from 'jsonwebtoken' import util from 'util' -import config from '../config.js' +import { config } from 'wasp/server' const jwtSign = util.promisify(jwt.sign) const jwtVerify = util.promisify(jwt.verify) const JWT_SECRET = config.auth.jwtSecret +// PRIVATE API export const signData = (data, options) => jwtSign(data, JWT_SECRET, options) +// PRIVATE API export const verify = (token) => jwtVerify(token, JWT_SECRET) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/logout.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/logout.ts similarity index 76% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/logout.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/logout.ts index 715f99a49b..2ecb055d9e 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/logout.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/logout.ts @@ -1,6 +1,7 @@ -import api, { removeLocalUserData } from '../api' -import { invalidateAndRemoveQueries } from '../operations/resources' +import { api, removeLocalUserData } from 'wasp/client/api' +import { invalidateAndRemoveQueries } from '../client/operations/internal/resources.js' +// PUBLIC API export default async function logout(): Promise { try { await api.post('/auth/logout') diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/lucia.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/lucia.ts similarity index 92% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/lucia.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/lucia.ts index bb9135c243..65f25de0ea 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/lucia.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/lucia.ts @@ -1,8 +1,7 @@ import { Lucia } from "lucia"; import { PrismaAdapter } from "@lucia-auth/adapter-prisma"; -import prisma from '../dbClient.js' -import config from '../config.js' -import { type User } from "../entities/index.js" +import { prisma } from 'wasp/server' +import { type User } from "wasp/entities" const prismaAdapter = new PrismaAdapter( // Using `as any` here since Lucia's model types are not compatible with Prisma 4 @@ -12,6 +11,7 @@ const prismaAdapter = new PrismaAdapter( prisma.auth as any ); +// PRIVATE API /** * We are using Lucia for session management. * diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/password.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/password.ts similarity index 94% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/password.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/password.ts index a359892b5e..9bccc80ad7 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/password.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/password.ts @@ -2,11 +2,13 @@ import SecurePassword from 'secure-password' const SP = new SecurePassword() +// PRIVATE API export const hashPassword = async (password: string): Promise => { const hashedPwdBuffer = await SP.hash(Buffer.from(password)) return hashedPwdBuffer.toString("base64") } +// PRIVATE API export const verifyPassword = async (hashedPassword: string, password: string): Promise => { const result = await SP.verify(Buffer.from(password), Buffer.from(hashedPassword, "base64")) if (result !== SecurePassword.VALID) { diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/types.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/providers/types.ts similarity index 90% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/types.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/providers/types.ts index f19198ca86..8cd06b8afc 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/types.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/providers/types.ts @@ -1,10 +1,16 @@ import type { Router, Request } from 'express' import type { Prisma } from '@prisma/client' -import type { Expand } from '../../universal/types' +import type { Expand } from 'wasp/universal/types' import type { ProviderName } from '../utils' +// PUBLIC API +export function defineUserSignupFields(fields: UserSignupFields) { + return fields +} + type UserEntityCreateInput = Prisma.UserCreateInput +// PRIVATE API export type ProviderConfig = { // Unique provider identifier, used as part of URL paths id: ProviderName; @@ -17,14 +23,18 @@ export type ProviderConfig = { createRouter(provider: ProviderConfig, initData: InitData): Router; }; +// PRIVATE API export type InitData = { [key: string]: any; } +// PRIVATE API export type RequestWithWasp = Request & { wasp?: { [key: string]: any } } +// PRIVATE API export type PossibleUserFields = Expand> +// PRIVATE API export type UserSignupFields = { [key in keyof PossibleUserFields]: FieldGetter< PossibleUserFields[key] @@ -34,7 +44,3 @@ export type UserSignupFields = { type FieldGetter = ( data: { [key: string]: unknown } ) => Promise | T | undefined - -export function defineUserSignupFields(fields: UserSignupFields) { - return fields -} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/session.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/session.ts similarity index 88% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/session.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/session.ts index ed9154120b..2558b2657b 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/session.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/session.ts @@ -1,7 +1,7 @@ import { Request as ExpressRequest } from "express"; -import { type User } from "../entities/index.js" -import { type SanitizedUser } from '../server/_types/index.js' +import { type User } from "wasp/entities" +import { type AuthUser } from 'wasp/auth' import { auth } from "./lucia.js"; import type { Session } from "lucia"; @@ -10,15 +10,17 @@ import { deserializeAndSanitizeProviderData, } from "./utils.js"; -import prisma from '../server/dbClient.js' +import { prisma } from 'wasp/server'; +// PRIVATE API // Creates a new session for the `authId` in the database export async function createSession(authId: string): Promise { return auth.createSession(authId, {}); } +// PRIVATE API export async function getSessionAndUserFromBearerToken(req: ExpressRequest): Promise<{ - user: SanitizedUser | null, + user: AuthUser | null, session: Session | null, }> { const authorizationHeader = req.headers["authorization"]; @@ -41,8 +43,9 @@ export async function getSessionAndUserFromBearerToken(req: ExpressRequest): Pro return getSessionAndUserFromSessionId(sessionId); } +// PRIVATE API export async function getSessionAndUserFromSessionId(sessionId: string): Promise<{ - user: SanitizedUser | null, + user: AuthUser | null, session: Session | null, }> { const { session, user: authEntity } = await auth.validateSession(sessionId); @@ -60,7 +63,7 @@ export async function getSessionAndUserFromSessionId(sessionId: string): Promise } } -async function getUser(userId: User['id']): Promise { +async function getUser(userId: User['id']): Promise { const user = await prisma.user .findUnique({ where: { id: userId }, @@ -102,6 +105,7 @@ async function getUser(userId: User['id']): Promise { } } +// PRIVATE API export function invalidateSession(sessionId: string): Promise { return auth.invalidateSession(sessionId); } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/types.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/types.ts new file mode 100644 index 0000000000..03d33b5016 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/types.ts @@ -0,0 +1,2 @@ +// todo(filip): turn into a proper import/path +export type { AuthUser, ProviderName, DeserializedAuthIdentity } from 'wasp/server/_types' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/useAuth.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/useAuth.ts similarity index 73% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/useAuth.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/useAuth.ts index f05d7220f6..c37c0e05b4 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/useAuth.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/useAuth.ts @@ -1,13 +1,13 @@ import { deserialize as superjsonDeserialize } from 'superjson' -import { useQuery } from '../queries' -import api, { handleApiError } from '../api' -import { HttpMethod } from '../types' -import type { User } from './types' -import { addMetadataToQuery } from '../queries/core' - +import { useQuery, addMetadataToQuery } from 'wasp/client/operations' +import { api, handleApiError } from 'wasp/client/api' +import { HttpMethod } from 'wasp/client' +import type { AuthUser } from './types' +// PUBLIC API export const getMe = createUserGetter() +// PUBLIC API export default function useAuth(queryFnArgs?: unknown, config?: any) { return useQuery(getMe, queryFnArgs, config) } @@ -15,7 +15,7 @@ export default function useAuth(queryFnArgs?: unknown, config?: any) { function createUserGetter() { const getMeRelativePath = 'auth/me' const getMeRoute = { method: HttpMethod.Get, path: `/${getMeRelativePath}` } - async function getMe(): Promise { + async function getMe(): Promise { try { const response = await api.get(getMeRoute.path) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/user.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/user.ts new file mode 100644 index 0000000000..f9bc6d39a3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/user.ts @@ -0,0 +1,27 @@ +import type { AuthUser, ProviderName, DeserializedAuthIdentity } from './types' + +// PUBLIC API +export function getEmail(user: AuthUser): string | null { + return findUserIdentity(user, "email")?.providerUserId ?? null; +} + +// PUBLIC API +export function getUsername(user: AuthUser): string | null { + return findUserIdentity(user, "username")?.providerUserId ?? null; +} + +// PUBLIC API +export function getFirstProviderUserId(user?: AuthUser): string | null { + if (!user || !user.auth || !user.auth.identities || user.auth.identities.length === 0) { + return null; + } + + return user.auth.identities[0].providerUserId ?? null; +} + +// PUBLIC API +export function findUserIdentity(user: AuthUser, providerName: ProviderName): DeserializedAuthIdentity | undefined { + return user.auth.identities.find( + (identity) => identity.providerName === providerName + ); +} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/utils.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/utils.ts similarity index 95% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/utils.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/utils.ts index dfde8ac98b..6187bf87fa 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/utils.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/utils.ts @@ -1,20 +1,19 @@ import { hashPassword } from './password.js' import { verify } from './jwt.js' -import AuthError from '../core/AuthError.js' -import HttpError from '../core/HttpError.js' -import prisma from '../dbClient.js' -import { sleep } from '../utils.js' +import { prisma, HttpError } from 'wasp/server' +import { sleep } from 'wasp/server/utils' import { type User, type Auth, type AuthIdentity, -} from '../entities/index.js' +} from 'wasp/entities' import { Prisma } from '@prisma/client'; import { throwValidationError } from './validation.js' import { type UserSignupFields, type PossibleUserFields } from './providers/types.js' +// PUBLIC API export type EmailProviderData = { hashedPassword: string; isEmailVerified: boolean; @@ -22,12 +21,15 @@ export type EmailProviderData = { passwordResetSentAt: string | null; } +// PUBLIC API export type UsernameProviderData = { hashedPassword: string; } +// PUBLIC API export type OAuthProviderData = {} +// PRIVATE API /** * This type is used for type-level programming e.g. to enumerate * all possible provider data types. @@ -42,19 +44,23 @@ export type PossibleProviderData = { github: OAuthProviderData; } +// PUBLIC API export type ProviderName = keyof PossibleProviderData +// PRIVATE API export const contextWithUserEntity = { entities: { User: prisma.user } } +// PRIVATE API export const authConfig = { failureRedirectPath: "/login", successRedirectPath: "/", } +// PUBLIC API /** * ProviderId uniquely identifies an auth identity e.g. * "email" provider with user id "test@test.com" or @@ -69,6 +75,7 @@ export type ProviderId = { providerUserId: string; } +// PUBLIC API export function createProviderId(providerName: ProviderName, providerUserId: string): ProviderId { return { providerName, @@ -76,6 +83,7 @@ export function createProviderId(providerName: ProviderName, providerUserId: str } } +// PUBLIC API export async function findAuthIdentity(providerId: ProviderId): Promise { return prisma.authIdentity.findUnique({ where: { @@ -84,6 +92,7 @@ export async function findAuthIdentity(providerId: ProviderId): Promise { return prisma.auth.findFirst({ where, include: { user: true }}); } +// PUBLIC API export async function createUser( providerId: ProviderId, serializedProviderData?: string, @@ -155,16 +166,19 @@ export async function createUser( }) } +// PRIVATE API export async function deleteUserByAuthId(authId: string): Promise<{ count: number }> { return prisma.user.deleteMany({ where: { auth: { id: authId, } } }) } +// PRIVATE API export async function verifyToken(token: string): Promise { return verify(token); } +// PRIVATE API // If an user exists, we don't want to leak information // about it. Pretending that we're doing some work // will make it harder for an attacker to determine @@ -177,11 +191,8 @@ export async function doFakeWork(): Promise { return sleep(timeToWork); } +// PRIVATE API export function rethrowPossibleAuthError(e: unknown): void { - if (e instanceof AuthError) { - throwValidationError(e.message); - } - // Prisma code P2002 is for unique constraint violations. if (e instanceof Prisma.PrismaClientKnownRequestError && e.code === 'P2002') { throw new HttpError(422, 'Save failed', { @@ -224,6 +235,7 @@ export function rethrowPossibleAuthError(e: unknown): void { throw e } +// PRIVATE API export async function validateAndGetUserFields( data: { [key: string]: unknown @@ -251,6 +263,7 @@ export async function validateAndGetUserFields( return result; } +// PUBLIC API export function deserializeAndSanitizeProviderData( providerData: string, { shouldRemovePasswordField = false }: { shouldRemovePasswordField?: boolean } = {}, @@ -265,6 +278,7 @@ export function deserializeAndSanitizeProviderData( return data; } +// PUBLIC API export async function sanitizeAndSerializeProviderData( providerData: PossibleProviderData[PN], ): Promise { @@ -297,6 +311,7 @@ function providerDataHasPasswordField( return 'hashedPassword' in providerData; } +// PRIVATE API export function throwInvalidCredentialsError(message?: string): void { throw new HttpError(401, 'Invalid credentials', { message }) } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/validation.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/validation.ts similarity index 95% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/validation.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/validation.ts index f384a28c87..637f4203fd 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/validation.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/validation.ts @@ -1,10 +1,11 @@ -import HttpError from '../core/HttpError.js'; +import { HttpError } from 'wasp/server'; export const PASSWORD_FIELD = 'password'; const USERNAME_FIELD = 'username'; const EMAIL_FIELD = 'email'; const TOKEN_FIELD = 'token'; +// PUBLIC API export function ensureValidEmail(args: unknown): void { validate(args, [ { validates: EMAIL_FIELD, message: 'email must be present', validator: email => !!email }, @@ -12,18 +13,21 @@ export function ensureValidEmail(args: unknown): void { ]); } +// PUBLIC API export function ensureValidUsername(args: unknown): void { validate(args, [ { validates: USERNAME_FIELD, message: 'username must be present', validator: username => !!username } ]); } +// PUBLIC API export function ensurePasswordIsPresent(args: unknown): void { validate(args, [ { validates: PASSWORD_FIELD, message: 'password must be present', validator: password => !!password }, ]); } +// PUBLIC API export function ensureValidPassword(args: unknown): void { validate(args, [ { validates: PASSWORD_FIELD, message: 'password must be at least 8 characters', validator: password => isMinLength(password, 8) }, @@ -31,12 +35,14 @@ export function ensureValidPassword(args: unknown): void { ]); } +// PUBLIC API export function ensureTokenIsPresent(args: unknown): void { validate(args, [ { validates: TOKEN_FIELD, message: 'token must be present', validator: token => !!token }, ]); } +// PRIVATE API export function throwValidationError(message: string): void { throw new HttpError(422, 'Validation failed', { message }) } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/auth/google.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/auth/google.ts new file mode 100644 index 0000000000..a3f0a98ac5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/auth/google.ts @@ -0,0 +1,2 @@ +// PUBLIC API +export { signInUrl as googleSignInUrl } from '../../auth/helpers/Google' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/auth/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/auth/index.ts new file mode 100644 index 0000000000..b481aef9e6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/auth/index.ts @@ -0,0 +1,8 @@ +export * from './ui' +export * from './google' +export { + default as useAuth, + getMe, +} from '../../auth/useAuth' + +export { default as logout } from '../../auth/logout' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/auth/ui.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/auth/ui.ts new file mode 100644 index 0000000000..96c316f695 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/auth/ui.ts @@ -0,0 +1,12 @@ +// PUBLIC API +export { LoginForm } from '../../auth/forms/Login' +export { SignupForm } from '../../auth/forms/Signup' +export type { CustomizationOptions } from '../../auth/forms/types' +export { SignInButton as GoogleSignInButton } from '../../auth/helpers/Google' +export { + FormError, + FormInput, + FormTextarea, + FormItemGroup, + FormLabel, +} from '../../auth/forms/internal/Form' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/crud/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/crud/index.ts new file mode 100644 index 0000000000..32af3f8217 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/crud/index.ts @@ -0,0 +1 @@ + export { tasks } from './tasks'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/crud/tasks.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/crud/tasks.ts similarity index 81% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/crud/tasks.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/crud/tasks.ts index 824fc8d7e4..0ce8e5bc35 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/crud/tasks.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/crud/tasks.ts @@ -1,12 +1,11 @@ -import { createAction } from "../actions/core"; -import { useAction } from "../actions"; -import { createQuery } from "../queries/core"; -import { useQuery } from "../queries"; +import { useAction, useQuery } from "wasp/client/operations"; +import { createAction } from "../operations/actions/core.js"; +import { createQuery } from "../operations/queries/core.js"; import { GetQueryResolved, GetAllQueryResolved, CreateActionResolved, -} from '../../../server/src/crud/tasks' +} from 'wasp/server/crud/tasks' function createCrud() { const crudGetQuery = createQuery( @@ -43,4 +42,5 @@ function createCrud() { } } +// PUBLIC API export const tasks = createCrud(); diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/types.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/index.ts similarity index 89% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/types.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/index.ts index 982b766e37..1972713940 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/types.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/index.ts @@ -1,3 +1,4 @@ +// PUBLIC API // NOTE: This is enough to cover Operations and our APIs (src/Wasp/AppSpec/Api.hs). export enum HttpMethod { Get = 'GET', @@ -6,4 +7,5 @@ export enum HttpMethod { Delete = 'DELETE', } +// PUBLIC API export type Route = { method: HttpMethod; path: string } diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/actions/core.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts similarity index 73% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/actions/core.d.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts index fa31f329ff..894c01f91c 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/actions/core.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts @@ -1,6 +1,7 @@ -import { type Action } from '.' -import type { Expand, _Awaited, _ReturnType } from '../universal/types' +import { type Action } from '../core.js' +import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types' +// PRIVATE API export function createAction( actionRoute: string, entitiesUsed: unknown[] diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/actions/core.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/actions/core.js similarity index 90% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/actions/core.js rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/actions/core.js index 440e906140..17dd6aba4d 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/actions/core.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/actions/core.js @@ -1,9 +1,10 @@ -import { callOperation, makeOperationRoute } from '../operations' +import { callOperation, makeOperationRoute } from '../internal/index.js' import { registerActionInProgress, registerActionDone, -} from '../operations/resources' +} from '../internal/resources.js' +// PRIVATE API export function createAction(relativeActionRoute, entitiesUsed) { const actionRoute = makeOperationRoute(relativeActionRoute) @@ -22,7 +23,7 @@ export function createAction(relativeActionRoute, entitiesUsed) { // 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 + // 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 diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/actions/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/actions/index.ts new file mode 100644 index 0000000000..9cfed7df16 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/actions/index.ts @@ -0,0 +1,8 @@ +import { createAction } from './core' +import { MySpecialAction } from 'wasp/server/operations/actions' + +// PUBLIC API +export const mySpecialAction = createAction( + 'operations/my-special-action', + ['User'], +) diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/actions/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/core.ts similarity index 64% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/actions/index.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/core.ts index 7fb2de2f9e..282c4698a7 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/actions/index.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/core.ts @@ -4,48 +4,95 @@ import { useMutation, UseMutationOptions, useQueryClient, -} from '@tanstack/react-query' -import { type Query } from '../queries'; + useQuery as rqUseQuery, + UseQueryResult, +} from "@tanstack/react-query"; +export { configureQueryClient } from "./queryClient"; -export type Action = - [Input] extends [never] ? - (args?: unknown) => Promise : - (args: Input) => Promise +// 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[] -} + optimisticUpdates: OptimisticUpdateDefinition[]; +}; +// PUBLIC API /** * A documented (public) way to define optimistic updates. */ export type OptimisticUpdateDefinition = { - getQuerySpecifier: GetQuerySpecifier - updateQuery: UpdateQuery -} + 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 +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 +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/data-model/operations/actions#the-useaction-hook-and-optimistic-updates + * https://wasp-lang.dev/docs/language/features#the-useaction-hook. */ -export type QuerySpecifier = [Query, ...any[]] +export type QuerySpecifier = [Query, ...any[]]; +// PUBLIC API /** * A hook for adding extra behavior to a Wasp Action (e.g., optimistic updates). * @@ -59,12 +106,20 @@ export function useAction
+ {logo && (Your Company)} + {title} +
+ + {errorMessage && ( + {errorMessage.title}{errorMessage.description && ': '}{errorMessage.description} + )} + {successMessage && {successMessage}} + + {(state === 'login' || state === 'signup') && ()} + + ); +} +// PRIVATE API +export default Auth; +//# sourceMappingURL=Auth.jsx.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Auth.jsx.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Auth.jsx.map new file mode 100644 index 0000000000..aa33e6834e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Auth.jsx.map @@ -0,0 +1 @@ +{"version":3,"file":"Auth.jsx","sourceRoot":"","sources":["../../../auth/forms/Auth.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAQlD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEjE,MAAM,SAAS,GAAG;IAChB,MAAM,EAAE,MAAM;CACf,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,EAAE;IAC9B,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;CACxB,CAAC,CAAA;AAEF,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE;IAC9B,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE,QAAQ;CACpB,CAAC,CAAA;AAGF,cAAc;AACd,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;IACvC,SAAS,EAAE,KAAK;IAChB,YAAY,EAAE,CAAC,SAAkB,EAAE,EAAE,GAAE,CAAC;IACxC,eAAe,EAAE,CAAC,YAAiC,EAAE,EAAE,GAAE,CAAC;IAC1D,iBAAiB,EAAE,CAAC,cAA6B,EAAE,EAAE,GAAE,CAAC;CACzD,CAAC,CAAA;AAEF,SAAS,IAAI,CAAE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,GAAG,YAAY,EAAE,sBAAsB,EAI5F;IACC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAsB,IAAI,CAAC,CAAC;IAC5E,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAC1E,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,iEAAiE;IACjE,uFAAuF;IACvF,qBAAqB;IACrB,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAE,CAAC,CAAA;IAEjD,MAAM,MAAM,GAA0B;QACpC,KAAK,EAAE,wBAAwB;QAC/B,MAAM,EAAE,sBAAsB;KAC/B,CAAA;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IAE3B,MAAM,sBAAsB,GAAG,YAAY,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAA;IAEtF,OAAO,CACL,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAChC;MAAA,CAAC,GAAG,CACF;QAAA,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,cAAc,EAAG,CAAC,CAClE;QAAA,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EAAE,UAAU,CACjC;MAAA,EAAE,GAAG,CAEL;;MAAA,CAAC,YAAY,IAAI,CACf,CAAC,YAAY,CACX;UAAA,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,YAAY,CAAC,WAAW,CACjF;QAAA,EAAE,YAAY,CAAC,CAChB,CACD;MAAA,CAAC,cAAc,IAAI,CAAC,cAAc,CAAC,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,CACpE;MAAA,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,CAAC,CAC3F;QAAA,CAAC,CAAC,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,QAAQ,CAAC,IAAI,CAC5C,CAAC,eAAe,CACd,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,sBAAsB,CAAC,CAAC,sBAAsB,CAAC,CAC/C,sBAAsB,CAAC,CAAC,sBAAsB,CAAC,EAC/C,CACH,CACH;MAAA,EAAE,WAAW,CAAC,QAAQ,CACxB;IAAA,EAAE,SAAS,CAAC,CACb,CAAA;AACH,CAAC;AAED,cAAc;AACd,eAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Login.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Login.d.ts new file mode 100644 index 0000000000..6abda02445 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Login.d.ts @@ -0,0 +1,3 @@ +/// +import { type CustomizationOptions } from './types'; +export declare function LoginForm({ appearance, logo, socialLayout, }: CustomizationOptions): import("react").JSX.Element; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Login.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Login.jsx new file mode 100644 index 0000000000..414b4f4651 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Login.jsx @@ -0,0 +1,7 @@ +import Auth from './Auth'; +import { State } from './types'; +// PUBLIC API +export function LoginForm({ appearance, logo, socialLayout, }) { + return (); +} +//# sourceMappingURL=Login.jsx.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Login.jsx.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Login.jsx.map new file mode 100644 index 0000000000..a87c9b6af2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Login.jsx.map @@ -0,0 +1 @@ +{"version":3,"file":"Login.jsx","sourceRoot":"","sources":["../../../auth/forms/Login.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAA;AACzB,OAAO,EAA6B,KAAK,EAAE,MAAM,SAAS,CAAA;AAE1D,aAAa;AACb,MAAM,UAAU,SAAS,CAAC,EACxB,UAAU,EACV,IAAI,EACJ,YAAY,GACS;IACrB,OAAO,CACL,CAAC,IAAI,CACH,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EACnB,CACH,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Signup.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Signup.d.ts new file mode 100644 index 0000000000..48416c73b8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Signup.d.ts @@ -0,0 +1,5 @@ +/// +import { type CustomizationOptions, type AdditionalSignupFields } from './types'; +export declare function SignupForm({ appearance, logo, socialLayout, additionalFields, }: CustomizationOptions & { + additionalFields?: AdditionalSignupFields; +}): import("react").JSX.Element; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Signup.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Signup.jsx new file mode 100644 index 0000000000..e2b995fbe8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Signup.jsx @@ -0,0 +1,7 @@ +import Auth from './Auth'; +import { State, } from './types'; +// PUBLIC API +export function SignupForm({ appearance, logo, socialLayout, additionalFields, }) { + return (); +} +//# sourceMappingURL=Signup.jsx.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Signup.jsx.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Signup.jsx.map new file mode 100644 index 0000000000..4f192211e7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/Signup.jsx.map @@ -0,0 +1 @@ +{"version":3,"file":"Signup.jsx","sourceRoot":"","sources":["../../../auth/forms/Signup.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAA;AACzB,OAAO,EAGL,KAAK,GACN,MAAM,SAAS,CAAA;AAEhB,aAAa;AACb,MAAM,UAAU,UAAU,CAAC,EACzB,UAAU,EACV,IAAI,EACJ,YAAY,EACZ,gBAAgB,GACsD;IACtE,OAAO,CACL,CAAC,IAAI,CACH,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CACpB,sBAAsB,CAAC,CAAC,gBAAgB,CAAC,EACzC,CACH,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.d.ts new file mode 100644 index 0000000000..db62b4ed23 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.d.ts @@ -0,0 +1,161 @@ +export declare const Form: import("@stitches/react/types/styled-component").StyledComponent<"form", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { + colors: { + waspYellow: string; + gray700: string; + gray600: string; + gray500: string; + gray400: string; + red: string; + darkRed: string; + green: string; + brand: string; + brandAccent: string; + errorBackground: string; + errorText: string; + successBackground: string; + successText: string; + submitButtonText: string; + formErrorText: string; + }; + fontSizes: { + sm: string; + }; +}, import("@stitches/react/types/config").DefaultThemeMap, {}>>; +export declare const FormItemGroup: import("@stitches/react/types/styled-component").StyledComponent<"div", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { + colors: { + waspYellow: string; + gray700: string; + gray600: string; + gray500: string; + gray400: string; + red: string; + darkRed: string; + green: string; + brand: string; + brandAccent: string; + errorBackground: string; + errorText: string; + successBackground: string; + successText: string; + submitButtonText: string; + formErrorText: string; + }; + fontSizes: { + sm: string; + }; +}, import("@stitches/react/types/config").DefaultThemeMap, {}>>; +export declare const FormLabel: import("@stitches/react/types/styled-component").StyledComponent<"label", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { + colors: { + waspYellow: string; + gray700: string; + gray600: string; + gray500: string; + gray400: string; + red: string; + darkRed: string; + green: string; + brand: string; + brandAccent: string; + errorBackground: string; + errorText: string; + successBackground: string; + successText: string; + submitButtonText: string; + formErrorText: string; + }; + fontSizes: { + sm: string; + }; +}, import("@stitches/react/types/config").DefaultThemeMap, {}>>; +export declare const FormInput: import("@stitches/react/types/styled-component").StyledComponent<"input", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { + colors: { + waspYellow: string; + gray700: string; + gray600: string; + gray500: string; + gray400: string; + red: string; + darkRed: string; + green: string; + brand: string; + brandAccent: string; + errorBackground: string; + errorText: string; + successBackground: string; + successText: string; + submitButtonText: string; + formErrorText: string; + }; + fontSizes: { + sm: string; + }; +}, import("@stitches/react/types/config").DefaultThemeMap, {}>>; +export declare const FormTextarea: import("@stitches/react/types/styled-component").StyledComponent<"textarea", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { + colors: { + waspYellow: string; + gray700: string; + gray600: string; + gray500: string; + gray400: string; + red: string; + darkRed: string; + green: string; + brand: string; + brandAccent: string; + errorBackground: string; + errorText: string; + successBackground: string; + successText: string; + submitButtonText: string; + formErrorText: string; + }; + fontSizes: { + sm: string; + }; +}, import("@stitches/react/types/config").DefaultThemeMap, {}>>; +export declare const FormError: import("@stitches/react/types/styled-component").StyledComponent<"div", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { + colors: { + waspYellow: string; + gray700: string; + gray600: string; + gray500: string; + gray400: string; + red: string; + darkRed: string; + green: string; + brand: string; + brandAccent: string; + errorBackground: string; + errorText: string; + successBackground: string; + successText: string; + submitButtonText: string; + formErrorText: string; + }; + fontSizes: { + sm: string; + }; +}, import("@stitches/react/types/config").DefaultThemeMap, {}>>; +export declare const SubmitButton: import("@stitches/react/types/styled-component").StyledComponent<"button", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { + colors: { + waspYellow: string; + gray700: string; + gray600: string; + gray500: string; + gray400: string; + red: string; + darkRed: string; + green: string; + brand: string; + brandAccent: string; + errorBackground: string; + errorText: string; + successBackground: string; + successText: string; + submitButtonText: string; + formErrorText: string; + }; + fontSizes: { + sm: string; + }; +}, import("@stitches/react/types/config").DefaultThemeMap, {}>>; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.jsx new file mode 100644 index 0000000000..fd5b55943e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.jsx @@ -0,0 +1,89 @@ +import { styled } from 'wasp/core/stitches.config'; +// PRIVATE API +export const Form = styled('form', { + marginTop: '1.5rem', +}); +// PUBLIC API +export const FormItemGroup = styled('div', { + '& + div': { + marginTop: '1.5rem', + }, +}); +// PUBLIC API +export const FormLabel = styled('label', { + display: 'block', + fontSize: '$sm', + fontWeight: '500', + marginBottom: '0.5rem', +}); +const commonInputStyles = { + display: 'block', + lineHeight: '1.5rem', + fontSize: '$sm', + borderWidth: '1px', + borderColor: '$gray600', + backgroundColor: '#f8f4ff', + boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)', + '&:focus': { + borderWidth: '1px', + borderColor: '$gray700', + boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)', + }, + '&:disabled': { + opacity: 0.5, + cursor: 'not-allowed', + backgroundColor: '$gray400', + borderColor: '$gray400', + color: '$gray500', + }, + borderRadius: '0.375rem', + width: '100%', + paddingTop: '0.375rem', + paddingBottom: '0.375rem', + paddingLeft: '0.75rem', + paddingRight: '0.75rem', + margin: 0, +}; +// PUBLIC API +export const FormInput = styled('input', commonInputStyles); +// PUBLIC API +export const FormTextarea = styled('textarea', commonInputStyles); +// PUBLIC API +export const FormError = styled('div', { + display: 'block', + fontSize: '$sm', + fontWeight: '500', + color: '$formErrorText', + marginTop: '0.5rem', +}); +// PRIVATE API +export const SubmitButton = styled('button', { + display: 'flex', + justifyContent: 'center', + width: '100%', + borderWidth: '1px', + borderColor: '$brand', + backgroundColor: '$brand', + color: '$submitButtonText', + padding: '0.5rem 0.75rem', + boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)', + fontWeight: '600', + fontSize: '$sm', + lineHeight: '1.25rem', + borderRadius: '0.375rem', + // TODO(matija): extract this into separate BaseButton component and then inherit it. + '&:hover': { + backgroundColor: '$brandAccent', + borderColor: '$brandAccent', + }, + '&:disabled': { + opacity: 0.5, + cursor: 'not-allowed', + backgroundColor: '$gray400', + borderColor: '$gray400', + color: '$gray500', + }, + transitionTimingFunction: 'cubic-bezier(0.4, 0, 0.2, 1)', + transitionDuration: '100ms', +}); +//# sourceMappingURL=Form.jsx.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.jsx.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.jsx.map new file mode 100644 index 0000000000..1e947e8a91 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.jsx.map @@ -0,0 +1 @@ +{"version":3,"file":"Form.jsx","sourceRoot":"","sources":["../../../../auth/forms/internal/Form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAElD,cAAc;AACd,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE;IACjC,SAAS,EAAE,QAAQ;CACpB,CAAC,CAAA;AAEF,aAAa;AACb,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,EAAE;IACzC,SAAS,EAAE;QACT,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAA;AAEF,aAAa;AACb,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,EAAE;IACvC,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,KAAK;IACjB,YAAY,EAAE,QAAQ;CACvB,CAAC,CAAA;AAEF,MAAM,iBAAiB,GAAG;IACxB,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,QAAQ;IACpB,QAAQ,EAAE,KAAK;IACf,WAAW,EAAE,KAAK;IAClB,WAAW,EAAE,UAAU;IACvB,eAAe,EAAE,SAAS;IAC1B,SAAS,EAAE,iCAAiC;IAC5C,SAAS,EAAE;QACT,WAAW,EAAE,KAAK;QAClB,WAAW,EAAE,UAAU;QACvB,SAAS,EAAE,iCAAiC;KAC7C;IACD,YAAY,EAAE;QACZ,OAAO,EAAE,GAAG;QACZ,MAAM,EAAE,aAAa;QACrB,eAAe,EAAE,UAAU;QAC3B,WAAW,EAAE,UAAU;QACvB,KAAK,EAAE,UAAU;KAClB;IAED,YAAY,EAAE,UAAU;IACxB,KAAK,EAAE,MAAM;IAEb,UAAU,EAAE,UAAU;IACtB,aAAa,EAAE,UAAU;IACzB,WAAW,EAAE,SAAS;IACtB,YAAY,EAAE,SAAS;IACvB,MAAM,EAAE,CAAC;CACV,CAAA;AAED,aAAa;AACb,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAA;AAE3D,aAAa;AACb,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAA;AAEjE,aAAa;AACb,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,EAAE;IACrC,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,KAAK;IACjB,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,QAAQ;CACpB,CAAC,CAAA;AAEF,cAAc;AACd,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,EAAE;IAC3C,OAAO,EAAE,MAAM;IACf,cAAc,EAAE,QAAQ;IAExB,KAAK,EAAE,MAAM;IACb,WAAW,EAAE,KAAK;IAClB,WAAW,EAAE,QAAQ;IACrB,eAAe,EAAE,QAAQ;IACzB,KAAK,EAAE,mBAAmB;IAE1B,OAAO,EAAE,gBAAgB;IACzB,SAAS,EAAE,iCAAiC;IAE5C,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,SAAS;IACrB,YAAY,EAAE,UAAU;IAExB,qFAAqF;IACrF,SAAS,EAAE;QACT,eAAe,EAAE,cAAc;QAC/B,WAAW,EAAE,cAAc;KAC5B;IACD,YAAY,EAAE;QACZ,OAAO,EAAE,GAAG;QACZ,MAAM,EAAE,aAAa;QACrB,eAAe,EAAE,UAAU;QAC3B,WAAW,EAAE,UAAU;QACvB,KAAK,EAAE,UAAU;KAClB;IACD,wBAAwB,EAAE,8BAA8B;IACxD,kBAAkB,EAAE,OAAO;CAC5B,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.d.ts new file mode 100644 index 0000000000..0b4031745c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.d.ts @@ -0,0 +1,113 @@ +export declare const Message: import("@stitches/react/types/styled-component").StyledComponent<"div", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { + colors: { + waspYellow: string; + gray700: string; + gray600: string; + gray500: string; + gray400: string; + red: string; + darkRed: string; + green: string; + brand: string; + brandAccent: string; + errorBackground: string; + errorText: string; + successBackground: string; + successText: string; + submitButtonText: string; + formErrorText: string; + }; + fontSizes: { + sm: string; + }; +}, import("@stitches/react/types/config").DefaultThemeMap, {}>>; +export declare const MessageError: import("@stitches/react/types/styled-component").StyledComponent>, {}, {}, import("@stitches/react/types/css-util").CSS<{}, { + colors: { + waspYellow: string; + gray700: string; + gray600: string; + gray500: string; + gray400: string; + red: string; + darkRed: string; + green: string; + brand: string; + brandAccent: string; + errorBackground: string; + errorText: string; + successBackground: string; + successText: string; + submitButtonText: string; + formErrorText: string; + }; + fontSizes: { + sm: string; + }; +}, import("@stitches/react/types/config").DefaultThemeMap, {}>>; +export declare const MessageSuccess: import("@stitches/react/types/styled-component").StyledComponent>, {}, {}, import("@stitches/react/types/css-util").CSS<{}, { + colors: { + waspYellow: string; + gray700: string; + gray600: string; + gray500: string; + gray400: string; + red: string; + darkRed: string; + green: string; + brand: string; + brandAccent: string; + errorBackground: string; + errorText: string; + successBackground: string; + successText: string; + submitButtonText: string; + formErrorText: string; + }; + fontSizes: { + sm: string; + }; +}, import("@stitches/react/types/config").DefaultThemeMap, {}>>; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.jsx new file mode 100644 index 0000000000..1cbff21591 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.jsx @@ -0,0 +1,19 @@ +import { styled } from 'wasp/core/stitches.config'; +// PRIVATE API +export const Message = styled('div', { + padding: '0.5rem 0.75rem', + borderRadius: '0.375rem', + marginTop: '1rem', + background: '$gray400', +}); +// PRIVATE API +export const MessageError = styled(Message, { + background: '$errorBackground', + color: '$errorText', +}); +// PRIVATE API +export const MessageSuccess = styled(Message, { + background: '$successBackground', + color: '$successText', +}); +//# sourceMappingURL=Message.jsx.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.jsx.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.jsx.map new file mode 100644 index 0000000000..ddc41b6cab --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.jsx.map @@ -0,0 +1 @@ +{"version":3,"file":"Message.jsx","sourceRoot":"","sources":["../../../../auth/forms/internal/Message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAElD,cAAc;AACd,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,EAAE;IACnC,OAAO,EAAE,gBAAgB;IACzB,YAAY,EAAE,UAAU;IACxB,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE,UAAU;CACvB,CAAC,CAAA;AAEF,cAAc;AACd,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,EAAE;IAC1C,UAAU,EAAE,kBAAkB;IAC9B,KAAK,EAAE,YAAY;CACpB,CAAC,CAAA;AAEF,cAAc;AACd,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,EAAE;IAC5C,UAAU,EAAE,oBAAoB;IAChC,KAAK,EAAE,cAAc;CACtB,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.d.ts new file mode 100644 index 0000000000..03671d2507 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.d.ts @@ -0,0 +1,10 @@ +/// +import type { AdditionalSignupFields } from '../../types'; +export type LoginSignupFormFields = { + [key: string]: string; +}; +export declare const LoginSignupForm: ({ state, socialButtonsDirection, additionalSignupFields, }: { + state: 'login' | 'signup'; + socialButtonsDirection?: 'horizontal' | 'vertical'; + additionalSignupFields?: AdditionalSignupFields; +}) => import("react").JSX.Element; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx new file mode 100644 index 0000000000..6e4995fcf6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx @@ -0,0 +1,98 @@ +import { useContext } from 'react'; +import { useForm } from 'react-hook-form'; +import { styled } from 'wasp/core/stitches.config'; +import config from 'wasp/core/config'; +import { AuthContext } from '../../Auth'; +import { FormInput, FormItemGroup, FormLabel, FormError, FormTextarea, } from '../Form'; +import * as SocialIcons from '../social/SocialIcons'; +import { SocialButton } from '../social/SocialButton'; +const SocialAuth = styled('div', { + marginTop: '1.5rem' +}); +const SocialAuthLabel = styled('div', { + fontWeight: '500', + fontSize: '$sm' +}); +const SocialAuthButtons = styled('div', { + marginTop: '0.5rem', + display: 'flex', + variants: { + direction: { + horizontal: { + display: 'grid', + gridTemplateColumns: 'repeat(auto-fit, minmax(48px, 1fr))', + }, + vertical: { + flexDirection: 'column', + margin: '8px 0', + } + }, + gap: { + small: { + gap: '4px', + }, + medium: { + gap: '8px', + }, + large: { + gap: '16px', + } + } + } +}); +const googleSignInUrl = `${config.apiUrl}/auth/google/login`; +// PRIVATE API +export const LoginSignupForm = ({ state, socialButtonsDirection = 'horizontal', additionalSignupFields, }) => { + const { isLoading, setErrorMessage, setSuccessMessage, setIsLoading, } = useContext(AuthContext); + const isLogin = state === 'login'; + const cta = isLogin ? 'Log in' : 'Sign up'; + const hookForm = useForm(); + const { register, formState: { errors }, handleSubmit: hookFormHandleSubmit } = hookForm; + return (<> + + {cta} with + + + + + + ); +}; +function AdditionalFormFields({ hookForm, formState: { isLoading }, additionalSignupFields, }) { + const { register, formState: { errors }, } = hookForm; + function renderField(field, + // Ideally we would use ComponentType here, but it doesn't work with react-hook-form + Component, props) { + return ( + {field.label} + + {errors[field.name] && ({errors[field.name].message})} + ); + } + if (areAdditionalFieldsRenderFn(additionalSignupFields)) { + return additionalSignupFields(hookForm, { isLoading }); + } + return (additionalSignupFields && + additionalSignupFields.map((field) => { + if (isFieldRenderFn(field)) { + return field(hookForm, { isLoading }); + } + switch (field.type) { + case 'input': + return renderField(field, FormInput, { + type: 'text', + }); + case 'textarea': + return renderField(field, FormTextarea); + default: + throw new Error(`Unsupported additional signup field type: ${field.type}`); + } + })); +} +function isFieldRenderFn(additionalSignupField) { + return typeof additionalSignupField === 'function'; +} +function areAdditionalFieldsRenderFn(additionalSignupFields) { + return typeof additionalSignupFields === 'function'; +} +//# sourceMappingURL=LoginSignupForm.jsx.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx.map new file mode 100644 index 0000000000..a487aedd70 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx.map @@ -0,0 +1 @@ +{"version":3,"file":"LoginSignupForm.jsx","sourceRoot":"","sources":["../../../../../auth/forms/internal/common/LoginSignupForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,OAAO,EAAiB,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAClD,OAAO,MAAM,MAAM,kBAAkB,CAAA;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAEL,SAAS,EACT,aAAa,EACb,SAAS,EACT,SAAS,EACT,YAAY,GAEb,MAAM,SAAS,CAAA;AAOhB,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAErD,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,EAAE;IAC7B,SAAS,EAAE,QAAQ;CACtB,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,EAAE;IAClC,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,KAAK;CAClB,CAAC,CAAA;AAEF,MAAM,iBAAiB,GAAG,MAAM,CAAC,KAAK,EAAE;IACpC,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,MAAM;IAEf,QAAQ,EAAE;QACN,SAAS,EAAE;YACP,UAAU,EAAE;gBACR,OAAO,EAAE,MAAM;gBACf,mBAAmB,EAAE,qCAAqC;aAC7D;YACD,QAAQ,EAAE;gBACN,aAAa,EAAE,QAAQ;gBACvB,MAAM,EAAE,OAAO;aAClB;SACJ;QACD,GAAG,EAAE;YACD,KAAK,EAAE;gBACH,GAAG,EAAE,KAAK;aACb;YACD,MAAM,EAAE;gBACJ,GAAG,EAAE,KAAK;aACb;YACD,KAAK,EAAE;gBACH,GAAG,EAAE,MAAM;aACd;SACJ;KACJ;CACJ,CAAC,CAAA;AACF,MAAM,eAAe,GAAG,GAAG,MAAM,CAAC,MAAM,oBAAoB,CAAA;AAO5D,cAAc;AACd,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC5B,KAAK,EACL,sBAAsB,GAAG,YAAY,EACrC,sBAAsB,GAKzB,EAAE,EAAE;IACH,MAAM,EACJ,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,YAAY,GACb,GAAG,UAAU,CAAC,WAAW,CAAC,CAAA;IAC3B,MAAM,OAAO,GAAG,KAAK,KAAK,OAAO,CAAA;IACjC,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3C,MAAM,QAAQ,GAAG,OAAO,EAAyB,CAAA;IACjD,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,oBAAoB,EAAE,GAAG,QAAQ,CAAA;IAExF,OAAO,CAAC,EACF;QAAA,CAAC,UAAU,CACT;UAAA,CAAC,eAAe,CAAC,CAAC,GAAG,CAAE,KAAI,EAAE,eAAe,CAC5C;UAAA,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,sBAAsB,CAAC,CAC7D;cAAA,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAA,EAAE,EAAE,YAAY,CAE5E;;UAAA,EAAE,iBAAiB,CACrB;QAAA,EAAE,UAAU,CAClB;EAAA,GAAG,CAAC,CAAA;AACN,CAAC,CAAA;AAED,SAAS,oBAAoB,CAAC,EAC5B,QAAQ,EACR,SAAS,EAAE,EAAE,SAAS,EAAE,EACxB,sBAAsB,GAKvB;IACC,MAAM,EACJ,QAAQ,EACR,SAAS,EAAE,EAAE,MAAM,EAAE,GACtB,GAAG,QAAQ,CAAC;IAEb,SAAS,WAAW,CAClB,KAA4B;IAC5B,oFAAoF;IACpF,SAAc,EACd,KAA2C;QAE3C,OAAO,CACL,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAC7B;QAAA,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,CACnC;QAAA,CAAC,SAAS,CACR,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAC5C,IAAI,KAAK,CAAC,CACV,QAAQ,CAAC,CAAC,SAAS,CAAC,EAEtB;QAAA,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CACrB,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CACpD,CACH;MAAA,EAAE,aAAa,CAAC,CACjB,CAAC;IACJ,CAAC;IAED,IAAI,2BAA2B,CAAC,sBAAsB,CAAC,EAAE;QACvD,OAAO,sBAAsB,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,CAAA;KACvD;IAED,OAAO,CACL,sBAAsB;QACtB,sBAAsB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACnC,IAAI,eAAe,CAAC,KAAK,CAAC,EAAE;gBAC1B,OAAO,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,CAAA;aACtC;YACD,QAAQ,KAAK,CAAC,IAAI,EAAE;gBAClB,KAAK,OAAO;oBACV,OAAO,WAAW,CAAmB,KAAK,EAAE,SAAS,EAAE;wBACrD,IAAI,EAAE,MAAM;qBACb,CAAC,CAAA;gBACJ,KAAK,UAAU;oBACb,OAAO,WAAW,CAAsB,KAAK,EAAE,YAAY,CAAC,CAAA;gBAC9D;oBACE,MAAM,IAAI,KAAK,CACb,6CAA6C,KAAK,CAAC,IAAI,EAAE,CAC1D,CAAA;aACJ;QACH,CAAC,CAAC,CACH,CAAA;AACH,CAAC;AAED,SAAS,eAAe,CACtB,qBAA4E;IAE5E,OAAO,OAAO,qBAAqB,KAAK,UAAU,CAAA;AACpD,CAAC;AAED,SAAS,2BAA2B,CAClC,sBAA8C;IAE9C,OAAO,OAAO,sBAAsB,KAAK,UAAU,CAAA;AACrD,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.d.ts new file mode 100644 index 0000000000..19b837bf98 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.d.ts @@ -0,0 +1,23 @@ +export declare const SocialButton: import("@stitches/react/types/styled-component").StyledComponent<"a", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { + colors: { + waspYellow: string; + gray700: string; + gray600: string; + gray500: string; + gray400: string; + red: string; + darkRed: string; + green: string; + brand: string; + brandAccent: string; + errorBackground: string; + errorText: string; + successBackground: string; + successText: string; + submitButtonText: string; + formErrorText: string; + }; + fontSizes: { + sm: string; + }; +}, import("@stitches/react/types/config").DefaultThemeMap, {}>>; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.jsx new file mode 100644 index 0000000000..2a598e7322 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.jsx @@ -0,0 +1,27 @@ +import { styled } from 'wasp/core/stitches.config'; +// PRIVATE API +export const SocialButton = styled('a', { + display: 'flex', + justifyContent: 'center', + cursor: 'pointer', + // NOTE(matija): icon is otherwise blue, since that + // is link's default font color. + color: 'inherit', + backgroundColor: '#f0f0f0', + borderRadius: '0.375rem', + borderWidth: '1px', + borderColor: '$gray600', + fontSize: '13px', + padding: '0.5rem 0.75rem', + boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)', + '&:visited': { + color: 'inherit', + }, + '&:hover': { + backgroundColor: '$gray500', + color: 'inherit', + }, + transitionTimingFunction: 'cubic-bezier(0.4, 0, 0.2, 1)', + transitionDuration: '100ms', +}); +//# sourceMappingURL=SocialButton.jsx.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.jsx.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.jsx.map new file mode 100644 index 0000000000..3683e9b18c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.jsx.map @@ -0,0 +1 @@ +{"version":3,"file":"SocialButton.jsx","sourceRoot":"","sources":["../../../../../auth/forms/internal/social/SocialButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAElD,cAAc;AACd,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,EAAE;IACtC,OAAO,EAAE,MAAM;IACf,cAAc,EAAE,QAAQ;IAExB,MAAM,EAAE,SAAS;IACjB,mDAAmD;IACnD,gCAAgC;IAChC,KAAK,EAAE,SAAS;IAChB,eAAe,EAAE,SAAS;IAC1B,YAAY,EAAE,UAAU;IACxB,WAAW,EAAE,KAAK;IAClB,WAAW,EAAE,UAAU;IACvB,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,gBAAgB;IACzB,SAAS,EAAE,iCAAiC;IAC5C,WAAW,EAAE;QACX,KAAK,EAAE,SAAS;KACjB;IACD,SAAS,EAAE;QACT,eAAe,EAAE,UAAU;QAC3B,KAAK,EAAE,SAAS;KACjB;IACD,wBAAwB,EAAE,8BAA8B;IACxD,kBAAkB,EAAE,OAAO;CAC5B,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialIcons.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialIcons.d.ts new file mode 100644 index 0000000000..7c03773a16 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialIcons.d.ts @@ -0,0 +1,3 @@ +/// +export declare const Google: () => import("react").JSX.Element; +export declare const GitHub: () => import("react").JSX.Element; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialIcons.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialIcons.jsx new file mode 100644 index 0000000000..df972a42bc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialIcons.jsx @@ -0,0 +1,18 @@ +import { css } from '@stitches/react'; +const defaultStyles = css({ + width: '1.25rem', + height: '1.25rem', +}); +// PRIVATE API +export const Google = () => (); +// PRIVATE API +export const GitHub = () => (); +//# sourceMappingURL=SocialIcons.jsx.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialIcons.jsx.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialIcons.jsx.map new file mode 100644 index 0000000000..e44f78705a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialIcons.jsx.map @@ -0,0 +1 @@ +{"version":3,"file":"SocialIcons.jsx","sourceRoot":"","sources":["../../../../../auth/forms/internal/social/SocialIcons.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAErC,MAAM,aAAa,GAAG,GAAG,CAAC;IACxB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;CAClB,CAAC,CAAA;AAEF,cAAc;AACd,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,CAC1B,CAAC,GAAG,CACF,SAAS,CAAC,CAAC,aAAa,EAAE,CAAC,CAC3B,WAAW,CAAC,MAAM,CAClB,IAAI,CAAC,cAAc,CACnB,OAAO,CAAC,WAAW,CAEnB;IAAA,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CACxE;MAAA,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAC9C;QAAA,CAAC,IAAI,CACH,CAAC,CAAC,sVAAsV,CACxV,EAAE,CAAC,OAAO,CACX,EAAE,IAAI,CACT;MAAA,EAAE,CAAC,CACL;IAAA,EAAE,CAAC,CACL;EAAA,EAAE,GAAG,CAAC,CACP,CAAA;AAED,cAAc;AACd,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,CAC1B,CAAC,GAAG,CACF,SAAS,CAAC,CAAC,aAAa,EAAE,CAAC,CAC3B,WAAW,CAAC,MAAM,CAClB,IAAI,CAAC,cAAc,CACnB,OAAO,CAAC,WAAW,CAEnB;IAAA,CAAC,IAAI,CACH,QAAQ,CAAC,SAAS,CAClB,CAAC,CAAC,ktBAAktB,CACptB,QAAQ,CAAC,SAAS,EAEtB;EAAA,EAAE,GAAG,CAAC,CACP,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/types.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/types.d.ts new file mode 100644 index 0000000000..b13dcdf28c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/types.d.ts @@ -0,0 +1,28 @@ +/// +import { createTheme } from '@stitches/react'; +import { UseFormReturn, RegisterOptions } from 'react-hook-form'; +import type { LoginSignupFormFields } from './internal/common/LoginSignupForm'; +export declare enum State { + Login = "login", + Signup = "signup" +} +export type CustomizationOptions = { + logo?: string; + socialLayout?: 'horizontal' | 'vertical'; + appearance?: Parameters[0]; +}; +export type ErrorMessage = { + title: string; + description?: string; +}; +export type FormState = { + isLoading: boolean; +}; +export type AdditionalSignupFieldRenderFn = (hookForm: UseFormReturn, formState: FormState) => React.ReactNode; +export type AdditionalSignupField = { + name: string; + label: string; + type: 'input' | 'textarea'; + validations?: RegisterOptions; +}; +export type AdditionalSignupFields = (AdditionalSignupField | AdditionalSignupFieldRenderFn)[] | AdditionalSignupFieldRenderFn; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/types.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/types.js new file mode 100644 index 0000000000..01caff0cef --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/types.js @@ -0,0 +1,7 @@ +// PRIVATE API +export var State; +(function (State) { + State["Login"] = "login"; + State["Signup"] = "signup"; +})(State || (State = {})); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/types.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/types.js.map new file mode 100644 index 0000000000..515af8bf72 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../auth/forms/types.ts"],"names":[],"mappings":"AAIA,cAAc;AACd,MAAM,CAAN,IAAY,KAGX;AAHD,WAAY,KAAK;IACf,wBAAe,CAAA;IACf,0BAAiB,CAAA;AACnB,CAAC,EAHW,KAAK,KAAL,KAAK,QAGhB"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/Google.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/Google.d.ts new file mode 100644 index 0000000000..680cb689e6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/Google.d.ts @@ -0,0 +1,3 @@ +/// +export declare const signInUrl: string; +export declare function SignInButton(): import("react").JSX.Element; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/Google.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/Google.jsx new file mode 100644 index 0000000000..b0d7b99cd7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/Google.jsx @@ -0,0 +1,12 @@ +import config from 'wasp/core/config'; +import { SocialButton } from '../forms/internal/social/SocialButton'; +import * as SocialIcons from '../forms/internal/social/SocialIcons'; +// PUBLIC API +export const signInUrl = `${config.apiUrl}/auth/google/login`; +// PUBLIC API +export function SignInButton() { + return ( + + ); +} +//# sourceMappingURL=Google.jsx.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/Google.jsx.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/Google.jsx.map new file mode 100644 index 0000000000..19621a889d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/Google.jsx.map @@ -0,0 +1 @@ +{"version":3,"file":"Google.jsx","sourceRoot":"","sources":["../../../auth/helpers/Google.tsx"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,kBAAkB,CAAA;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAA;AACpE,OAAO,KAAK,WAAW,MAAM,sCAAsC,CAAA;AAEnE,aAAa;AACb,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,MAAM,CAAC,MAAM,oBAAoB,CAAA;AAE7D,aAAa;AACb,MAAM,UAAU,YAAY;IAC1B,OAAO,CACL,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,WAAW,CAAC,MAAM,CAAC,AAAD,EACrB;IAAA,EAAE,YAAY,CAAC,CAChB,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/user.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/user.d.ts new file mode 100644 index 0000000000..87c050dfee --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/user.d.ts @@ -0,0 +1 @@ +export declare function initSession(sessionId: string): Promise; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/user.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/user.js new file mode 100644 index 0000000000..f0280aa604 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/user.js @@ -0,0 +1,14 @@ +import { setSessionId } from 'wasp/client/api'; +import { invalidateAndRemoveQueries } from '../../client/operations/internal/resources.js'; +// PRIVATE API +export async function initSession(sessionId) { + setSessionId(sessionId); + // We need to invalidate queries after login in order to get the correct user + // data in the React components (using `useAuth`). + // Redirects after login won't work properly without this. + // TODO(filip): We are currently removing all the queries, but we should + // remove only non-public, user-dependent queries - public queries are + // expected not to change in respect to the currently logged in user. + await invalidateAndRemoveQueries(); +} +//# sourceMappingURL=user.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/user.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/user.js.map new file mode 100644 index 0000000000..049e303ec3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/helpers/user.js.map @@ -0,0 +1 @@ +{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../auth/helpers/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAA;AAE1F,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,SAAiB;IAC/C,YAAY,CAAC,SAAS,CAAC,CAAA;IACvB,6EAA6E;IAC7E,kDAAkD;IAClD,0DAA0D;IAE1D,wEAAwE;IACxE,sEAAsE;IACtE,qEAAqE;IACrE,MAAM,0BAA0B,EAAE,CAAA;AACtC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/index.d.ts new file mode 100644 index 0000000000..d8af2d2c13 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/index.d.ts @@ -0,0 +1,2 @@ +export type { AuthUser } from '../server/_types'; +export { getEmail, getUsername, getFirstProviderUserId, findUserIdentity } from './user.js'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/index.js new file mode 100644 index 0000000000..6f46b386c0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/index.js @@ -0,0 +1,2 @@ +export { getEmail, getUsername, getFirstProviderUserId, findUserIdentity } from './user.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/index.js.map new file mode 100644 index 0000000000..dae5c6bd53 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../auth/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/jwt.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/jwt.d.ts new file mode 100644 index 0000000000..0982a1dbd2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/jwt.d.ts @@ -0,0 +1,2 @@ +export declare const signData: (data: any, options: any) => any; +export declare const verify: (token: any) => any; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/jwt.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/jwt.js new file mode 100644 index 0000000000..f4d5ae7158 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/jwt.js @@ -0,0 +1,11 @@ +import jwt from 'jsonwebtoken'; +import util from 'util'; +import { config } from 'wasp/server'; +const jwtSign = util.promisify(jwt.sign); +const jwtVerify = util.promisify(jwt.verify); +const JWT_SECRET = config.auth.jwtSecret; +// PRIVATE API +export const signData = (data, options) => jwtSign(data, JWT_SECRET, options); +// PRIVATE API +export const verify = (token) => jwtVerify(token, JWT_SECRET); +//# sourceMappingURL=jwt.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/jwt.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/jwt.js.map new file mode 100644 index 0000000000..50f922bf32 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/jwt.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jwt.js","sourceRoot":"","sources":["../../auth/jwt.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,cAAc,CAAA;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AACxC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AAE5C,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAA;AAExC,cAAc;AACd,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;AAC7E,cAAc;AACd,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/logout.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/logout.d.ts new file mode 100644 index 0000000000..eb14076896 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/logout.d.ts @@ -0,0 +1 @@ +export default function logout(): Promise; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/logout.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/logout.js new file mode 100644 index 0000000000..21dcc7f6a5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/logout.js @@ -0,0 +1,18 @@ +import { api, removeLocalUserData } from 'wasp/client/api'; +import { invalidateAndRemoveQueries } from '../client/operations/internal/resources.js'; +// PUBLIC API +export default async function logout() { + try { + await api.post('/auth/logout'); + } + finally { + // Even if the logout request fails, we still want to remove the local user data + // in case the logout failed because of a network error and the user walked away + // from the computer. + removeLocalUserData(); + // TODO(filip): We are currently invalidating and removing all the queries, but + // we should remove only the non-public, user-dependent ones. + await invalidateAndRemoveQueries(); + } +} +//# sourceMappingURL=logout.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/logout.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/logout.js.map new file mode 100644 index 0000000000..9a273d47e5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/logout.js.map @@ -0,0 +1 @@ +{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../auth/logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAA;AAEvF,aAAa;AACb,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,MAAM;IAClC,IAAI;QACF,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;KAC/B;YAAS;QACR,gFAAgF;QAChF,gFAAgF;QAChF,qBAAqB;QACrB,mBAAmB,EAAE,CAAA;QAErB,gFAAgF;QAChF,6DAA6D;QAC7D,MAAM,0BAA0B,EAAE,CAAA;KACnC;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/lucia.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/lucia.d.ts new file mode 100644 index 0000000000..6c083ba4fd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/lucia.d.ts @@ -0,0 +1,25 @@ +import { Lucia } from "lucia"; +import { type User } from "wasp/entities"; +/** + * We are using Lucia for session management. + * + * Some details: + * 1. We are using the Prisma adapter for Lucia. + * 2. We are not using cookies for session management. Instead, we are using + * the Authorization header to send the session token. + * 3. Our `Session` entity is connected to the `Auth` entity. + * 4. We are exposing the `userId` field from the `Auth` entity to + * make fetching the User easier. + */ +export declare const auth: Lucia<{}, { + userId: User['id']; +}>; +declare module "lucia" { + interface Register { + Lucia: typeof auth; + DatabaseSessionAttributes: {}; + DatabaseUserAttributes: { + userId: User['id']; + }; + } +} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/lucia.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/lucia.js new file mode 100644 index 0000000000..ac6fb405a8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/lucia.js @@ -0,0 +1,38 @@ +import { Lucia } from "lucia"; +import { PrismaAdapter } from "@lucia-auth/adapter-prisma"; +import { prisma } from 'wasp/server'; +const prismaAdapter = new PrismaAdapter( +// Using `as any` here since Lucia's model types are not compatible with Prisma 4 +// model types. This is a temporary workaround until we migrate to Prisma 5. +// This **works** in runtime, but Typescript complains about it. +prisma.session, prisma.auth); +// PRIVATE API +/** + * We are using Lucia for session management. + * + * Some details: + * 1. We are using the Prisma adapter for Lucia. + * 2. We are not using cookies for session management. Instead, we are using + * the Authorization header to send the session token. + * 3. Our `Session` entity is connected to the `Auth` entity. + * 4. We are exposing the `userId` field from the `Auth` entity to + * make fetching the User easier. + */ +export const auth = new Lucia(prismaAdapter, { + // Since we are not using cookies, we don't need to set any cookie options. + // But in the future, if we decide to use cookies, we can set them here. + // sessionCookie: { + // name: "session", + // expires: true, + // attributes: { + // secure: !config.isDevelopment, + // sameSite: "lax", + // }, + // }, + getUserAttributes({ userId }) { + return { + userId, + }; + }, +}); +//# sourceMappingURL=lucia.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/lucia.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/lucia.js.map new file mode 100644 index 0000000000..5742228cbe --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/lucia.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lucia.js","sourceRoot":"","sources":["../../auth/lucia.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGpC,MAAM,aAAa,GAAG,IAAI,aAAa;AACrC,iFAAiF;AACjF,4EAA4E;AAC5E,gEAAgE;AAChE,MAAM,CAAC,OAAc,EACrB,MAAM,CAAC,IAAW,CACnB,CAAC;AAEF,cAAc;AACd;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,KAAK,CAE1B,aAAa,EAAE;IAChB,2EAA2E;IAC3E,wEAAwE;IAExE,mBAAmB;IACnB,qBAAqB;IACrB,mBAAmB;IACnB,kBAAkB;IAClB,qCAAqC;IACrC,uBAAuB;IACvB,OAAO;IACP,KAAK;IACL,iBAAiB,CAAC,EAAE,MAAM,EAAE;QAC1B,OAAO;YACL,MAAM;SACP,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/password.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/password.d.ts new file mode 100644 index 0000000000..71a926eb40 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/password.d.ts @@ -0,0 +1,2 @@ +export declare const hashPassword: (password: string) => Promise; +export declare const verifyPassword: (hashedPassword: string, password: string) => Promise; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/password.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/password.js new file mode 100644 index 0000000000..c942637382 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/password.js @@ -0,0 +1,15 @@ +import SecurePassword from 'secure-password'; +const SP = new SecurePassword(); +// PRIVATE API +export const hashPassword = async (password) => { + const hashedPwdBuffer = await SP.hash(Buffer.from(password)); + return hashedPwdBuffer.toString("base64"); +}; +// PRIVATE API +export const verifyPassword = async (hashedPassword, password) => { + const result = await SP.verify(Buffer.from(password), Buffer.from(hashedPassword, "base64")); + if (result !== SecurePassword.VALID) { + throw new Error('Invalid password.'); + } +}; +//# sourceMappingURL=password.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/password.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/password.js.map new file mode 100644 index 0000000000..443d60e3e6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/password.js.map @@ -0,0 +1 @@ +{"version":3,"file":"password.js","sourceRoot":"","sources":["../../auth/password.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,iBAAiB,CAAA;AAE5C,MAAM,EAAE,GAAG,IAAI,cAAc,EAAE,CAAA;AAE/B,cAAc;AACd,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,QAAgB,EAAmB,EAAE;IACtE,MAAM,eAAe,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC5D,OAAO,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;AAC3C,CAAC,CAAA;AAED,cAAc;AACd,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,cAAsB,EAAE,QAAgB,EAAiB,EAAE;IAC9F,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAA;IAC5F,IAAI,MAAM,KAAK,cAAc,CAAC,KAAK,EAAE;QACnC,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAA;KACrC;AACH,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/providers/types.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/providers/types.d.ts new file mode 100644 index 0000000000..8ac8c45ae2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/providers/types.d.ts @@ -0,0 +1,28 @@ +import type { Router, Request } from 'express'; +import type { Prisma } from '@prisma/client'; +import type { Expand } from 'wasp/universal/types'; +import type { ProviderName } from '../utils'; +export declare function defineUserSignupFields(fields: UserSignupFields): UserSignupFields; +type UserEntityCreateInput = Prisma.UserCreateInput; +export type ProviderConfig = { + id: ProviderName; + displayName: string; + init?(provider: ProviderConfig): Promise; + createRouter(provider: ProviderConfig, initData: InitData): Router; +}; +export type InitData = { + [key: string]: any; +}; +export type RequestWithWasp = Request & { + wasp?: { + [key: string]: any; + }; +}; +export type PossibleUserFields = Expand>; +export type UserSignupFields = { + [key in keyof PossibleUserFields]: FieldGetter; +}; +type FieldGetter = (data: { + [key: string]: unknown; +}) => Promise | T | undefined; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/providers/types.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/providers/types.js new file mode 100644 index 0000000000..eadfaa053b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/providers/types.js @@ -0,0 +1,5 @@ +// PUBLIC API +export function defineUserSignupFields(fields) { + return fields; +} +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/providers/types.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/providers/types.js.map new file mode 100644 index 0000000000..367559bafb --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/providers/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../auth/providers/types.ts"],"names":[],"mappings":"AAKA,aAAa;AACb,MAAM,UAAU,sBAAsB,CAAC,MAAwB;IAC7D,OAAO,MAAM,CAAA;AACf,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.d.ts new file mode 100644 index 0000000000..2c4ae8c6d7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.d.ts @@ -0,0 +1,13 @@ +import { Request as ExpressRequest } from "express"; +import { type AuthUser } from 'wasp/auth'; +import type { Session } from "lucia"; +export declare function createSession(authId: string): Promise; +export declare function getSessionAndUserFromBearerToken(req: ExpressRequest): Promise<{ + user: AuthUser | null; + session: Session | null; +}>; +export declare function getSessionAndUserFromSessionId(sessionId: string): Promise<{ + user: AuthUser | null; + session: Session | null; +}>; +export declare function invalidateSession(sessionId: string): Promise; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js new file mode 100644 index 0000000000..e96768ebfd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js @@ -0,0 +1,72 @@ +import { auth } from "./lucia.js"; +import { throwInvalidCredentialsError, deserializeAndSanitizeProviderData, } from "./utils.js"; +import { prisma } from 'wasp/server'; +// PRIVATE API +// Creates a new session for the `authId` in the database +export async function createSession(authId) { + return auth.createSession(authId, {}); +} +// PRIVATE API +export async function getSessionAndUserFromBearerToken(req) { + const authorizationHeader = req.headers["authorization"]; + if (typeof authorizationHeader !== "string") { + return { + user: null, + session: null, + }; + } + const sessionId = auth.readBearerToken(authorizationHeader); + if (!sessionId) { + return { + user: null, + session: null, + }; + } + return getSessionAndUserFromSessionId(sessionId); +} +// PRIVATE API +export async function getSessionAndUserFromSessionId(sessionId) { + const { session, user: authEntity } = await auth.validateSession(sessionId); + if (!session || !authEntity) { + return { + user: null, + session: null, + }; + } + return { + session, + user: await getUser(authEntity.userId) + }; +} +async function getUser(userId) { + const user = await prisma.user + .findUnique({ + where: { id: userId }, + include: { + auth: { + include: { + identities: true + } + } + } + }); + if (!user) { + throwInvalidCredentialsError(); + } + // TODO: This logic must match the type in _types/index.ts (if we remove the + // password field from the object here, we must to do the same there). + // Ideally, these two things would live in the same place: + // https://github.com/wasp-lang/wasp/issues/965 + const deserializedIdentities = user.auth.identities.map((identity) => { + const deserializedProviderData = deserializeAndSanitizeProviderData(identity.providerData, { + shouldRemovePasswordField: true, + }); + return Object.assign(Object.assign({}, identity), { providerData: deserializedProviderData }); + }); + return Object.assign(Object.assign({}, user), { auth: Object.assign(Object.assign({}, user.auth), { identities: deserializedIdentities }) }); +} +// PRIVATE API +export function invalidateSession(sessionId) { + return auth.invalidateSession(sessionId); +} +//# sourceMappingURL=session.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js.map new file mode 100644 index 0000000000..62a2542c41 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js.map @@ -0,0 +1 @@ +{"version":3,"file":"session.js","sourceRoot":"","sources":["../../auth/session.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,EACL,4BAA4B,EAC5B,kCAAkC,GACnC,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,cAAc;AACd,yDAAyD;AACzD,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAc;IAChD,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACxC,CAAC;AAED,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,gCAAgC,CAAC,GAAmB;IAIxE,MAAM,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAEzD,IAAI,OAAO,mBAAmB,KAAK,QAAQ,EAAE;QAC3C,OAAO;YACL,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,IAAI;SACd,CAAC;KACH;IAED,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC;IAC5D,IAAI,CAAC,SAAS,EAAE;QACd,OAAO;YACL,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,IAAI;SACd,CAAC;KACH;IAED,OAAO,8BAA8B,CAAC,SAAS,CAAC,CAAC;AACnD,CAAC;AAED,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAAC,SAAiB;IAIpE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IAE5E,IAAI,CAAC,OAAO,IAAI,CAAC,UAAU,EAAE;QAC3B,OAAO;YACL,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,IAAI;SACd,CAAC;KACH;IAED,OAAO;QACL,OAAO;QACP,IAAI,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;KACvC,CAAA;AACH,CAAC;AAED,KAAK,UAAU,OAAO,CAAC,MAAkB;IACvC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI;SAC3B,UAAU,CAAC;QACV,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;QACrB,OAAO,EAAE;YACP,IAAI,EAAE;gBACJ,OAAO,EAAE;oBACP,UAAU,EAAE,IAAI;iBACjB;aACF;SACF;KACF,CAAC,CAAA;IAEJ,IAAI,CAAC,IAAI,EAAE;QACT,4BAA4B,EAAE,CAAA;KAC/B;IAED,4EAA4E;IAC5E,sEAAsE;IACtE,0DAA0D;IAC1D,+CAA+C;IAC/C,MAAM,sBAAsB,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;QACnE,MAAM,wBAAwB,GAAG,kCAAkC,CACjE,QAAQ,CAAC,YAAY,EACrB;YACE,yBAAyB,EAAE,IAAI;SAChC,CACF,CAAA;QACD,uCACK,QAAQ,KACX,YAAY,EAAE,wBAAwB,IACvC;IACH,CAAC,CAAC,CAAA;IACF,uCACK,IAAI,KACP,IAAI,kCACC,IAAI,CAAC,IAAI,KACZ,UAAU,EAAE,sBAAsB,OAErC;AACH,CAAC;AAED,cAAc;AACd,MAAM,UAAU,iBAAiB,CAAC,SAAiB;IACjD,OAAO,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;AAC3C,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/types.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/types.d.ts new file mode 100644 index 0000000000..58b46e668b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/types.d.ts @@ -0,0 +1 @@ +export type { AuthUser, ProviderName, DeserializedAuthIdentity } from 'wasp/server/_types'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/types.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/types.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/types.js.map new file mode 100644 index 0000000000..b7f26de5b1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../auth/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.d.ts new file mode 100644 index 0000000000..f6f6f5e2fb --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.d.ts @@ -0,0 +1,3 @@ +import type { AuthUser } from './types'; +export declare const getMe: () => Promise; +export default function useAuth(queryFnArgs?: unknown, config?: any): import("@tanstack/react-query").UseQueryResult; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js new file mode 100644 index 0000000000..9029f7877f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js @@ -0,0 +1,36 @@ +import { deserialize as superjsonDeserialize } from 'superjson'; +import { useQuery, addMetadataToQuery } from 'wasp/client/operations'; +import { api, handleApiError } from 'wasp/client/api'; +import { HttpMethod } from 'wasp/client'; +// PUBLIC API +export const getMe = createUserGetter(); +// PUBLIC API +export default function useAuth(queryFnArgs, config) { + return useQuery(getMe, queryFnArgs, config); +} +function createUserGetter() { + const getMeRelativePath = 'auth/me'; + const getMeRoute = { method: HttpMethod.Get, path: `/${getMeRelativePath}` }; + async function getMe() { + var _a; + try { + const response = await api.get(getMeRoute.path); + return superjsonDeserialize(response.data); + } + catch (error) { + if (((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 401) { + return null; + } + else { + handleApiError(error); + } + } + } + addMetadataToQuery(getMe, { + relativeQueryPath: getMeRelativePath, + queryRoute: getMeRoute, + entitiesUsed: ['User'], + }); + return getMe; +} +//# sourceMappingURL=useAuth.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js.map new file mode 100644 index 0000000000..b735970c81 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"useAuth.js","sourceRoot":"","sources":["../../auth/useAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAC/D,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGxC,aAAa;AACb,MAAM,CAAC,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAA;AAEvC,aAAa;AACb,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,WAAqB,EAAE,MAAY;IACjE,OAAO,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAA;AAC7C,CAAC;AAED,SAAS,gBAAgB;IACvB,MAAM,iBAAiB,GAAG,SAAS,CAAA;IACnC,MAAM,UAAU,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,iBAAiB,EAAE,EAAE,CAAA;IAC5E,KAAK,UAAU,KAAK;;QAClB,IAAI;YACF,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;YAE/C,OAAO,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;SAC3C;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,MAAK,GAAG,EAAE;gBAClC,OAAO,IAAI,CAAA;aACZ;iBAAM;gBACL,cAAc,CAAC,KAAK,CAAC,CAAA;aACtB;SACF;IACH,CAAC;IAED,kBAAkB,CAAC,KAAK,EAAE;QACxB,iBAAiB,EAAE,iBAAiB;QACpC,UAAU,EAAE,UAAU;QACtB,YAAY,EAAE,CAAC,MAAM,CAAC;KACvB,CAAC,CAAA;IAEF,OAAO,KAAK,CAAA;AACd,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.d.ts new file mode 100644 index 0000000000..1d79a05195 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.d.ts @@ -0,0 +1,5 @@ +import type { AuthUser, ProviderName, DeserializedAuthIdentity } from './types'; +export declare function getEmail(user: AuthUser): string | null; +export declare function getUsername(user: AuthUser): string | null; +export declare function getFirstProviderUserId(user?: AuthUser): string | null; +export declare function findUserIdentity(user: AuthUser, providerName: ProviderName): DeserializedAuthIdentity | undefined; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js new file mode 100644 index 0000000000..2eff9a9ad2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js @@ -0,0 +1,23 @@ +// PUBLIC API +export function getEmail(user) { + var _a, _b; + return (_b = (_a = findUserIdentity(user, "email")) === null || _a === void 0 ? void 0 : _a.providerUserId) !== null && _b !== void 0 ? _b : null; +} +// PUBLIC API +export function getUsername(user) { + var _a, _b; + return (_b = (_a = findUserIdentity(user, "username")) === null || _a === void 0 ? void 0 : _a.providerUserId) !== null && _b !== void 0 ? _b : null; +} +// PUBLIC API +export function getFirstProviderUserId(user) { + var _a; + if (!user || !user.auth || !user.auth.identities || user.auth.identities.length === 0) { + return null; + } + return (_a = user.auth.identities[0].providerUserId) !== null && _a !== void 0 ? _a : null; +} +// PUBLIC API +export function findUserIdentity(user, providerName) { + return user.auth.identities.find((identity) => identity.providerName === providerName); +} +//# sourceMappingURL=user.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js.map new file mode 100644 index 0000000000..1a5670967f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js.map @@ -0,0 +1 @@ +{"version":3,"file":"user.js","sourceRoot":"","sources":["../../auth/user.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,MAAM,UAAU,QAAQ,CAAC,IAAc;;IACrC,OAAO,MAAA,MAAA,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,0CAAE,cAAc,mCAAI,IAAI,CAAC;AACjE,CAAC;AAED,aAAa;AACb,MAAM,UAAU,WAAW,CAAC,IAAc;;IACxC,OAAO,MAAA,MAAA,gBAAgB,CAAC,IAAI,EAAE,UAAU,CAAC,0CAAE,cAAc,mCAAI,IAAI,CAAC;AACpE,CAAC;AAED,aAAa;AACb,MAAM,UAAU,sBAAsB,CAAC,IAAe;;IACpD,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;QACrF,OAAO,IAAI,CAAC;KACb;IAED,OAAO,MAAA,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,cAAc,mCAAI,IAAI,CAAC;AACxD,CAAC;AAED,aAAa;AACb,MAAM,UAAU,gBAAgB,CAAC,IAAc,EAAE,YAA0B;IACzE,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAC9B,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,YAAY,KAAK,YAAY,CACrD,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.d.ts new file mode 100644 index 0000000000..52a7b1147c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.d.ts @@ -0,0 +1,82 @@ +import { type User, type Auth, type AuthIdentity } from 'wasp/entities'; +import { Prisma } from '@prisma/client'; +import { type UserSignupFields, type PossibleUserFields } from './providers/types.js'; +export type EmailProviderData = { + hashedPassword: string; + isEmailVerified: boolean; + emailVerificationSentAt: string | null; + passwordResetSentAt: string | null; +}; +export type UsernameProviderData = { + hashedPassword: string; +}; +export type OAuthProviderData = {}; +/** + * This type is used for type-level programming e.g. to enumerate + * all possible provider data types. + * + * The keys of this type are the names of the providers and the values + * are the types of the provider data. + */ +export type PossibleProviderData = { + email: EmailProviderData; + username: UsernameProviderData; + google: OAuthProviderData; + github: OAuthProviderData; +}; +export type ProviderName = keyof PossibleProviderData; +export declare const contextWithUserEntity: { + entities: { + User: Prisma.UserDelegate; + }; +}; +export declare const authConfig: { + failureRedirectPath: string; + successRedirectPath: string; +}; +/** + * ProviderId uniquely identifies an auth identity e.g. + * "email" provider with user id "test@test.com" or + * "google" provider with user id "1234567890". + * + * We use this type to avoid passing the providerName and providerUserId + * separately. Also, we can normalize the providerUserId to make sure it's + * consistent across different DB operations. + */ +export type ProviderId = { + providerName: ProviderName; + providerUserId: string; +}; +export declare function createProviderId(providerName: ProviderName, providerUserId: string): ProviderId; +export declare function findAuthIdentity(providerId: ProviderId): Promise; +/** + * Updates the provider data for the given auth identity. + * + * This function performs data sanitization and serialization. + * Sanitization is done by hashing the password, so this function + * expects the password received in the `providerDataUpdates` + * **not to be hashed**. + */ +export declare function updateAuthIdentityProviderData(providerId: ProviderId, existingProviderData: PossibleProviderData[PN], providerDataUpdates: Partial): Promise; +type FindAuthWithUserResult = Auth & { + user: User; +}; +export declare function findAuthWithUserBy(where: Prisma.AuthWhereInput): Promise; +export declare function createUser(providerId: ProviderId, serializedProviderData?: string, userFields?: PossibleUserFields): Promise; +export declare function deleteUserByAuthId(authId: string): Promise<{ + count: number; +}>; +export declare function verifyToken(token: string): Promise; +export declare function doFakeWork(): Promise; +export declare function rethrowPossibleAuthError(e: unknown): void; +export declare function validateAndGetUserFields(data: { + [key: string]: unknown; +}, userSignupFields?: UserSignupFields): Promise>; +export declare function deserializeAndSanitizeProviderData(providerData: string, { shouldRemovePasswordField }?: { + shouldRemovePasswordField?: boolean; +}): PossibleProviderData[PN]; +export declare function sanitizeAndSerializeProviderData(providerData: PossibleProviderData[PN]): Promise; +export declare function throwInvalidCredentialsError(message?: string): void; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js new file mode 100644 index 0000000000..1ccee30746 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js @@ -0,0 +1,200 @@ +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 { hashPassword } from './password.js'; +import { verify } from './jwt.js'; +import { prisma, HttpError } from 'wasp/server'; +import { sleep } from 'wasp/server/utils'; +import { Prisma } from '@prisma/client'; +import { throwValidationError } from './validation.js'; +// PRIVATE API +export const contextWithUserEntity = { + entities: { + User: prisma.user + } +}; +// PRIVATE API +export const authConfig = { + failureRedirectPath: "/login", + successRedirectPath: "/", +}; +// PUBLIC API +export function createProviderId(providerName, providerUserId) { + return { + providerName, + providerUserId: providerUserId.toLowerCase(), + }; +} +// PUBLIC API +export async function findAuthIdentity(providerId) { + return prisma.authIdentity.findUnique({ + where: { + providerName_providerUserId: providerId, + } + }); +} +// PUBLIC API +/** + * Updates the provider data for the given auth identity. + * + * This function performs data sanitization and serialization. + * Sanitization is done by hashing the password, so this function + * expects the password received in the `providerDataUpdates` + * **not to be hashed**. + */ +export async function updateAuthIdentityProviderData(providerId, existingProviderData, providerDataUpdates) { + // We are doing the sanitization here only on updates to avoid + // hashing the password multiple times. + const sanitizedProviderDataUpdates = await sanitizeProviderData(providerDataUpdates); + const newProviderData = Object.assign(Object.assign({}, existingProviderData), sanitizedProviderDataUpdates); + const serializedProviderData = await serializeProviderData(newProviderData); + return prisma.authIdentity.update({ + where: { + providerName_providerUserId: providerId, + }, + data: { providerData: serializedProviderData }, + }); +} +// PRIVATE API +export async function findAuthWithUserBy(where) { + return prisma.auth.findFirst({ where, include: { user: true } }); +} +// PUBLIC API +export async function createUser(providerId, serializedProviderData, userFields) { + return prisma.user.create({ + data: Object.assign(Object.assign({}, (userFields !== null && userFields !== void 0 ? userFields : {})), { auth: { + create: { + identities: { + create: { + providerName: providerId.providerName, + providerUserId: providerId.providerUserId, + providerData: serializedProviderData, + }, + }, + } + } }), + // We need to include the Auth entity here because we need `authId` + // to be able to create a session. + include: { + auth: true, + }, + }); +} +// PRIVATE API +export async function deleteUserByAuthId(authId) { + return prisma.user.deleteMany({ where: { auth: { + id: authId, + } } }); +} +// PRIVATE API +export async function verifyToken(token) { + return verify(token); +} +// PRIVATE API +// If an user exists, we don't want to leak information +// about it. Pretending that we're doing some work +// will make it harder for an attacker to determine +// if a user exists or not. +// NOTE: Attacker measuring time to response can still determine +// if a user exists or not. We'll be able to avoid it when +// we implement e-mail sending via jobs. +export async function doFakeWork() { + const timeToWork = Math.floor(Math.random() * 1000) + 1000; + return sleep(timeToWork); +} +// PRIVATE API +export function rethrowPossibleAuthError(e) { + // Prisma code P2002 is for unique constraint violations. + if (e instanceof Prisma.PrismaClientKnownRequestError && e.code === 'P2002') { + throw new HttpError(422, 'Save failed', { + message: `user with the same identity already exists`, + }); + } + if (e instanceof Prisma.PrismaClientValidationError) { + // NOTE: Logging the error since this usually means that there are + // required fields missing in the request, we want the developer + // to know about it. + console.error(e); + throw new HttpError(422, 'Save failed', { + message: 'there was a database error' + }); + } + // Prisma code P2021 is for missing table errors. + if (e instanceof Prisma.PrismaClientKnownRequestError && e.code === 'P2021') { + // NOTE: Logging the error since this usually means that the database + // migrations weren't run, we want the developer to know about it. + console.error(e); + console.info('🐝 This error can happen if you did\'t run the database migrations.'); + throw new HttpError(500, 'Save failed', { + message: `there was a database error`, + }); + } + // Prisma code P2003 is for foreign key constraint failure + if (e instanceof Prisma.PrismaClientKnownRequestError && e.code === 'P2003') { + console.error(e); + console.info(`🐝 This error can happen if you have some relation on your User entity + but you didn't specify the "onDelete" behaviour to either "Cascade" or "SetNull". + Read more at: https://www.prisma.io/docs/orm/prisma-schema/data-model/relations/referential-actions`); + throw new HttpError(500, 'Save failed', { + message: `there was a database error`, + }); + } + throw e; +} +// PRIVATE API +export async function validateAndGetUserFields(data, userSignupFields) { + const { password: _password } = data, sanitizedData = __rest(data, ["password"]); + const result = {}; + if (!userSignupFields) { + return result; + } + for (const [field, getFieldValue] of Object.entries(userSignupFields)) { + try { + const value = await getFieldValue(sanitizedData); + result[field] = value; + } + catch (e) { + throwValidationError(e.message); + } + } + return result; +} +// PUBLIC API +export function deserializeAndSanitizeProviderData(providerData, { shouldRemovePasswordField = false } = {}) { + // NOTE: We are letting JSON.parse throw an error if the providerData is not valid JSON. + let data = JSON.parse(providerData); + if (providerDataHasPasswordField(data) && shouldRemovePasswordField) { + delete data.hashedPassword; + } + return data; +} +// PUBLIC API +export async function sanitizeAndSerializeProviderData(providerData) { + return serializeProviderData(await sanitizeProviderData(providerData)); +} +function serializeProviderData(providerData) { + return JSON.stringify(providerData); +} +async function sanitizeProviderData(providerData) { + const data = Object.assign({}, providerData); + if (providerDataHasPasswordField(data)) { + data.hashedPassword = await hashPassword(data.hashedPassword); + } + return data; +} +function providerDataHasPasswordField(providerData) { + return 'hashedPassword' in providerData; +} +// PRIVATE API +export function throwInvalidCredentialsError(message) { + throw new HttpError(401, 'Invalid credentials', { message }); +} +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js.map new file mode 100644 index 0000000000..0e94c0625e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../auth/utils.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAMzC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAsCtD,cAAc;AACd,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC,IAAI;KAClB;CACF,CAAA;AAED,cAAc;AACd,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,mBAAmB,EAAE,QAAQ;IAC7B,mBAAmB,EAAE,GAAG;CACzB,CAAA;AAiBD,aAAa;AACb,MAAM,UAAU,gBAAgB,CAAC,YAA0B,EAAE,cAAsB;IACjF,OAAO;QACL,YAAY;QACZ,cAAc,EAAE,cAAc,CAAC,WAAW,EAAE;KAC7C,CAAA;AACH,CAAC;AAED,aAAa;AACb,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,UAAsB;IAC3D,OAAO,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC;QACpC,KAAK,EAAE;YACL,2BAA2B,EAAE,UAAU;SACxC;KACF,CAAC,CAAC;AACL,CAAC;AAED,aAAa;AACb;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,UAAsB,EACtB,oBAA8C,EAC9C,mBAAsD;IAEtD,8DAA8D;IAC9D,uCAAuC;IACvC,MAAM,4BAA4B,GAAG,MAAM,oBAAoB,CAAC,mBAAmB,CAAC,CAAC;IACrF,MAAM,eAAe,mCAChB,oBAAoB,GACpB,4BAA4B,CAChC,CAAA;IACD,MAAM,sBAAsB,GAAG,MAAM,qBAAqB,CAAK,eAAe,CAAC,CAAC;IAChF,OAAO,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC;QAChC,KAAK,EAAE;YACL,2BAA2B,EAAE,UAAU;SACxC;QACD,IAAI,EAAE,EAAE,YAAY,EAAE,sBAAsB,EAAE;KAC/C,CAAC,CAAC;AACL,CAAC;AAMD,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,KAA4B;IAE5B,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAC,CAAC,CAAC;AAClE,CAAC;AAED,aAAa;AACb,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,UAAsB,EACtB,sBAA+B,EAC/B,UAA+B;IAI/B,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;QACxB,IAAI,kCAGC,CAAC,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAS,CAAC,KAC5B,IAAI,EAAE;gBACJ,MAAM,EAAE;oBACN,UAAU,EAAE;wBACR,MAAM,EAAE;4BACJ,YAAY,EAAE,UAAU,CAAC,YAAY;4BACrC,cAAc,EAAE,UAAU,CAAC,cAAc;4BACzC,YAAY,EAAE,sBAAsB;yBACvC;qBACJ;iBACF;aACF,GACF;QACD,mEAAmE;QACnE,kCAAkC;QAClC,OAAO,EAAE;YACP,IAAI,EAAE,IAAI;SACX;KACF,CAAC,CAAA;AACJ,CAAC;AAED,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,MAAc;IACrD,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE;gBAC7C,EAAE,EAAE,MAAM;aACX,EAAE,EAAE,CAAC,CAAA;AACR,CAAC;AAED,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,WAAW,CAAc,KAAa;IAC1D,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,cAAc;AACd,uDAAuD;AACvD,kDAAkD;AAClD,mDAAmD;AACnD,2BAA2B;AAC3B,gEAAgE;AAChE,2DAA2D;AAC3D,wCAAwC;AACxC,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC3D,OAAO,KAAK,CAAC,UAAU,CAAC,CAAC;AAC3B,CAAC;AAED,cAAc;AACd,MAAM,UAAU,wBAAwB,CAAC,CAAU;IACjD,yDAAyD;IACzD,IAAI,CAAC,YAAY,MAAM,CAAC,6BAA6B,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,EAAE;QAC3E,MAAM,IAAI,SAAS,CAAC,GAAG,EAAE,aAAa,EAAE;YACtC,OAAO,EAAE,4CAA4C;SACtD,CAAC,CAAA;KACH;IAED,IAAI,CAAC,YAAY,MAAM,CAAC,2BAA2B,EAAE;QACnD,kEAAkE;QAClE,gEAAgE;QAChE,oBAAoB;QACpB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAChB,MAAM,IAAI,SAAS,CAAC,GAAG,EAAE,aAAa,EAAE;YACtC,OAAO,EAAE,4BAA4B;SACtC,CAAC,CAAA;KACH;IAED,iDAAiD;IACjD,IAAI,CAAC,YAAY,MAAM,CAAC,6BAA6B,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,EAAE;QAC3E,qEAAqE;QACrE,kEAAkE;QAClE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAChB,OAAO,CAAC,IAAI,CAAC,qEAAqE,CAAC,CAAA;QACnF,MAAM,IAAI,SAAS,CAAC,GAAG,EAAE,aAAa,EAAE;YACtC,OAAO,EAAE,4BAA4B;SACtC,CAAC,CAAA;KACH;IAED,0DAA0D;IAC1D,IAAI,CAAC,YAAY,MAAM,CAAC,6BAA6B,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,EAAE;QAC3E,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAChB,OAAO,CAAC,IAAI,CAAC;;uGAEsF,CAAC,CAAA;QACpG,MAAM,IAAI,SAAS,CAAC,GAAG,EAAE,aAAa,EAAE;YACtC,OAAO,EAAE,4BAA4B;SACtC,CAAC,CAAA;KACH;IAED,MAAM,CAAC,CAAA;AACT,CAAC;AAED,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,IAEC,EACD,gBAAmC;IAEnC,MAAM,EACJ,QAAQ,EAAE,SAAS,KAEjB,IAAI,EADH,aAAa,UACd,IAAI,EAHF,YAGL,CAAO,CAAC;IACT,MAAM,MAAM,GAAwB,EAAE,CAAC;IAEvC,IAAI,CAAC,gBAAgB,EAAE;QACrB,OAAO,MAAM,CAAC;KACf;IAED,KAAK,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;QACrE,IAAI;YACF,MAAM,KAAK,GAAG,MAAM,aAAa,CAAC,aAAa,CAAC,CAAA;YAChD,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAA;SACtB;QAAC,OAAO,CAAC,EAAE;YACV,oBAAoB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;SAChC;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,aAAa;AACb,MAAM,UAAU,kCAAkC,CAChD,YAAoB,EACpB,EAAE,yBAAyB,GAAG,KAAK,KAA8C,EAAE;IAEnF,wFAAwF;IACxF,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAA6B,CAAC;IAEhE,IAAI,4BAA4B,CAAC,IAAI,CAAC,IAAI,yBAAyB,EAAE;QACnE,OAAO,IAAI,CAAC,cAAc,CAAC;KAC5B;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,aAAa;AACb,MAAM,CAAC,KAAK,UAAU,gCAAgC,CACpD,YAAsC;IAEtC,OAAO,qBAAqB,CAC1B,MAAM,oBAAoB,CAAC,YAAY,CAAC,CACzC,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAA0B,YAAsC;IAC5F,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;AACtC,CAAC;AAED,KAAK,UAAU,oBAAoB,CACjC,YAAsC;IAEtC,MAAM,IAAI,qBACL,YAAY,CAChB,CAAC;IACF,IAAI,4BAA4B,CAAC,IAAI,CAAC,EAAE;QACtC,IAAI,CAAC,cAAc,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;KAC/D;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAGD,SAAS,4BAA4B,CACnC,YAA8D;IAE9D,OAAO,gBAAgB,IAAI,YAAY,CAAC;AAC1C,CAAC;AAED,cAAc;AACd,MAAM,UAAU,4BAA4B,CAAC,OAAgB;IAC3D,MAAM,IAAI,SAAS,CAAC,GAAG,EAAE,qBAAqB,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;AAC9D,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.d.ts new file mode 100644 index 0000000000..489a6ee3da --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.d.ts @@ -0,0 +1,7 @@ +export declare const PASSWORD_FIELD = "password"; +export declare function ensureValidEmail(args: unknown): void; +export declare function ensureValidUsername(args: unknown): void; +export declare function ensurePasswordIsPresent(args: unknown): void; +export declare function ensureValidPassword(args: unknown): void; +export declare function ensureTokenIsPresent(args: unknown): void; +export declare function throwValidationError(message: string): void; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.js new file mode 100644 index 0000000000..bfde1d0681 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.js @@ -0,0 +1,69 @@ +import { HttpError } from 'wasp/server'; +export const PASSWORD_FIELD = 'password'; +const USERNAME_FIELD = 'username'; +const EMAIL_FIELD = 'email'; +const TOKEN_FIELD = 'token'; +// PUBLIC API +export function ensureValidEmail(args) { + validate(args, [ + { validates: EMAIL_FIELD, message: 'email must be present', validator: email => !!email }, + { validates: EMAIL_FIELD, message: 'email must be a valid email', validator: email => isValidEmail(email) }, + ]); +} +// PUBLIC API +export function ensureValidUsername(args) { + validate(args, [ + { validates: USERNAME_FIELD, message: 'username must be present', validator: username => !!username } + ]); +} +// PUBLIC API +export function ensurePasswordIsPresent(args) { + validate(args, [ + { validates: PASSWORD_FIELD, message: 'password must be present', validator: password => !!password }, + ]); +} +// PUBLIC API +export function ensureValidPassword(args) { + validate(args, [ + { validates: PASSWORD_FIELD, message: 'password must be at least 8 characters', validator: password => isMinLength(password, 8) }, + { validates: PASSWORD_FIELD, message: 'password must contain a number', validator: password => containsNumber(password) }, + ]); +} +// PUBLIC API +export function ensureTokenIsPresent(args) { + validate(args, [ + { validates: TOKEN_FIELD, message: 'token must be present', validator: token => !!token }, + ]); +} +// PRIVATE API +export function throwValidationError(message) { + throw new HttpError(422, 'Validation failed', { message }); +} +function validate(args, validators) { + for (const { validates, message, validator } of validators) { + if (!validator(args[validates])) { + throwValidationError(message); + } + } +} +// NOTE(miho): it would be good to replace our custom validations with e.g. Zod +const validEmailRegex = /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/; +function isValidEmail(input) { + if (typeof input !== 'string') { + return false; + } + return input.match(validEmailRegex) !== null; +} +function isMinLength(input, minLength) { + if (typeof input !== 'string') { + return false; + } + return input.length >= minLength; +} +function containsNumber(input) { + if (typeof input !== 'string') { + return false; + } + return /\d/.test(input); +} +//# sourceMappingURL=validation.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.js.map new file mode 100644 index 0000000000..efa7527731 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../auth/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AACzC,MAAM,cAAc,GAAG,UAAU,CAAC;AAClC,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,WAAW,GAAG,OAAO,CAAC;AAE5B,aAAa;AACb,MAAM,UAAU,gBAAgB,CAAC,IAAa;IAC5C,QAAQ,CAAC,IAAI,EAAE;QACb,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE;QACzF,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,6BAA6B,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;KAC5G,CAAC,CAAC;AACL,CAAC;AAED,aAAa;AACb,MAAM,UAAU,mBAAmB,CAAC,IAAa;IAC/C,QAAQ,CAAC,IAAI,EAAE;QACb,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,0BAA0B,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;KACtG,CAAC,CAAC;AACL,CAAC;AAED,aAAa;AACb,MAAM,UAAU,uBAAuB,CAAC,IAAa;IACnD,QAAQ,CAAC,IAAI,EAAE;QACb,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,0BAA0B,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;KACtG,CAAC,CAAC;AACL,CAAC;AAED,aAAa;AACb,MAAM,UAAU,mBAAmB,CAAC,IAAa;IAC/C,QAAQ,CAAC,IAAI,EAAE;QACb,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,wCAAwC,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE;QACjI,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,gCAAgC,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;KAC1H,CAAC,CAAC;AACL,CAAC;AAED,aAAa;AACb,MAAM,UAAU,oBAAoB,CAAC,IAAa;IAChD,QAAQ,CAAC,IAAI,EAAE;QACb,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE;KAC1F,CAAC,CAAC;AACL,CAAC;AAED,cAAc;AACd,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,MAAM,IAAI,SAAS,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;AAC5D,CAAC;AAED,SAAS,QAAQ,CAAC,IAAa,EAAE,UAA4F;IAC3H,KAAK,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,UAAU,EAAE;QAC1D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE;YAC/B,oBAAoB,CAAC,OAAO,CAAC,CAAC;SAC/B;KACF;AACH,CAAC;AAED,+EAA+E;AAE/E,MAAM,eAAe,GAAG,gcAAgc,CAAA;AACxd,SAAS,YAAY,CAAC,KAAc;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,OAAO,KAAK,CAAA;KACf;IAED,OAAO,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,IAAI,CAAA;AAChD,CAAC;AAED,SAAS,WAAW,CAAC,KAAc,EAAE,SAAiB;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,OAAO,KAAK,CAAA;KACf;IAED,OAAO,KAAK,CAAC,MAAM,IAAI,SAAS,CAAA;AACpC,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,OAAO,KAAK,CAAA;KACf;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC3B,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/google.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/google.d.ts new file mode 100644 index 0000000000..c996773c93 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/google.d.ts @@ -0,0 +1 @@ +export { signInUrl as googleSignInUrl } from '../../auth/helpers/Google'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/google.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/google.js new file mode 100644 index 0000000000..7e1d1717e1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/google.js @@ -0,0 +1,3 @@ +// PUBLIC API +export { signInUrl as googleSignInUrl } from '../../auth/helpers/Google'; +//# sourceMappingURL=google.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/google.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/google.js.map new file mode 100644 index 0000000000..2a31808b5d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/google.js.map @@ -0,0 +1 @@ +{"version":3,"file":"google.js","sourceRoot":"","sources":["../../../client/auth/google.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/index.d.ts new file mode 100644 index 0000000000..5e2264179d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/index.d.ts @@ -0,0 +1,4 @@ +export * from './ui'; +export * from './google'; +export { default as useAuth, getMe, } from '../../auth/useAuth'; +export { default as logout } from '../../auth/logout'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/index.js new file mode 100644 index 0000000000..2fb318b0e9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/index.js @@ -0,0 +1,5 @@ +export * from './ui'; +export * from './google'; +export { default as useAuth, getMe, } from '../../auth/useAuth'; +export { default as logout } from '../../auth/logout'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/index.js.map new file mode 100644 index 0000000000..4d6d512af4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAA;AACpB,cAAc,UAAU,CAAA;AACxB,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,GACN,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/ui.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/ui.d.ts new file mode 100644 index 0000000000..efe32fa1c5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/ui.d.ts @@ -0,0 +1,5 @@ +export { LoginForm } from '../../auth/forms/Login'; +export { SignupForm } from '../../auth/forms/Signup'; +export type { CustomizationOptions } from '../../auth/forms/types'; +export { SignInButton as GoogleSignInButton } from '../../auth/helpers/Google'; +export { FormError, FormInput, FormTextarea, FormItemGroup, FormLabel, } from '../../auth/forms/internal/Form'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/ui.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/ui.js new file mode 100644 index 0000000000..1ae4dafc57 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/ui.js @@ -0,0 +1,6 @@ +// PUBLIC API +export { LoginForm } from '../../auth/forms/Login'; +export { SignupForm } from '../../auth/forms/Signup'; +export { SignInButton as GoogleSignInButton } from '../../auth/helpers/Google'; +export { FormError, FormInput, FormTextarea, FormItemGroup, FormLabel, } from '../../auth/forms/internal/Form'; +//# sourceMappingURL=ui.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/ui.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/ui.js.map new file mode 100644 index 0000000000..0cee6e0069 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/auth/ui.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../../client/auth/ui.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEpD,OAAO,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EACL,SAAS,EACT,SAAS,EACT,YAAY,EACZ,aAAa,EACb,SAAS,GACV,MAAM,gCAAgC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/index.d.ts new file mode 100644 index 0000000000..6413dd75de --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/index.d.ts @@ -0,0 +1 @@ +export { tasks } from './tasks'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/index.js new file mode 100644 index 0000000000..f015874927 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/index.js @@ -0,0 +1,2 @@ +export { tasks } from './tasks'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/index.js.map new file mode 100644 index 0000000000..d1e61040b1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/crud/index.ts"],"names":[],"mappings":"AAAE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.d.ts new file mode 100644 index 0000000000..2ba4388c01 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.d.ts @@ -0,0 +1,39 @@ +import { GetQueryResolved } from 'wasp/server/crud/tasks'; +export declare const tasks: { + get: { + query: (queryCacheKey: string[], args: import(".prisma/client").Prisma.TaskWhereUniqueInput) => Promise & {}>; + useQuery(args: Parameters[0]): import("@tanstack/react-query").UseQueryResult & {}, Error>; + }; + getAll: { + query: (queryCacheKey: string[], args: {}) => Promise<(import("@prisma/client/runtime/index.js").GetResult<{ + id: number; + description: string; + isDone: boolean; + }, unknown> & {})[]>; + useQuery(): import("@tanstack/react-query").UseQueryResult<(import("@prisma/client/runtime/index.js").GetResult<{ + id: number; + description: string; + isDone: boolean; + }, unknown> & {})[], Error>; + }; + create: { + action: (args: import(".prisma/client").Prisma.TaskCreateInput) => Promise & {}>; + useAction(): (args: import(".prisma/client").Prisma.TaskCreateInput) => Promise & {}>; + }; +}; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.js new file mode 100644 index 0000000000..934f47ed0b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.js @@ -0,0 +1,31 @@ +import { useAction, useQuery } from "wasp/client/operations"; +import { createAction } from "../operations/actions/core.js"; +import { createQuery } from "../operations/queries/core.js"; +function createCrud() { + const crudGetQuery = createQuery('tasks/get', ['Task']); + const crudGetAllQuery = createQuery('tasks/get-all', ['Task']); + const crudCreateAction = createAction('tasks/create', ['Task']); + return { + get: { + query: crudGetQuery, + useQuery(args) { + return useQuery(crudGetQuery, args); + } + }, + getAll: { + query: crudGetAllQuery, + useQuery() { + return useQuery(crudGetAllQuery); + } + }, + create: { + action: crudCreateAction, + useAction() { + return useAction(crudCreateAction); + } + }, + }; +} +// PUBLIC API +export const tasks = createCrud(); +//# sourceMappingURL=tasks.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.js.map new file mode 100644 index 0000000000..d103ee9b93 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../../client/crud/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAO5D,SAAS,UAAU;IACf,MAAM,YAAY,GAAG,WAAW,CAC5B,WAAW,EACX,CAAC,MAAM,CAAC,CACX,CAAA;IACD,MAAM,eAAe,GAAG,WAAW,CAC/B,eAAe,EACf,CAAC,MAAM,CAAC,CACX,CAAA;IACD,MAAM,gBAAgB,GAAG,YAAY,CACjC,cAAc,EACd,CAAC,MAAM,CAAC,CACX,CAAA;IACD,OAAO;QACH,GAAG,EAAE;YACD,KAAK,EAAE,YAAY;YACnB,QAAQ,CAAC,IAAqC;gBAC1C,OAAO,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;YACxC,CAAC;SACJ;QACD,MAAM,EAAE;YACJ,KAAK,EAAE,eAAe;YACtB,QAAQ;gBACJ,OAAO,QAAQ,CAAC,eAAe,CAAC,CAAC;YACrC,CAAC;SACJ;QACD,MAAM,EAAE;YACJ,MAAM,EAAE,gBAAgB;YACxB,SAAS;gBACL,OAAO,SAAS,CAAC,gBAAgB,CAAC,CAAC;YACvC,CAAC;SACJ;KACJ,CAAA;AACL,CAAC;AAED,aAAa;AACb,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.d.ts new file mode 100644 index 0000000000..fd6cf83b9e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js new file mode 100644 index 0000000000..c13afdb0c7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js.map new file mode 100644 index 0000000000..b7394b3505 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts new file mode 100644 index 0000000000..e2c6699d11 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js new file mode 100644 index 0000000000..51abcbe936 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map new file mode 100644 index 0000000000..5834336f1d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts new file mode 100644 index 0000000000..0d1fad08f2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts @@ -0,0 +1 @@ +export declare const mySpecialAction: (args: any) => Promise; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js new file mode 100644 index 0000000000..2a8ebeb062 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js @@ -0,0 +1,4 @@ +import { createAction } from './core'; +// PUBLIC API +export const mySpecialAction = createAction('operations/my-special-action', ['User']); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map new file mode 100644 index 0000000000..3b7e7fce4d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAGrC,aAAa;AACb,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CACzC,8BAA8B,EAC9B,CAAC,MAAM,CAAC,CACT,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts new file mode 100644 index 0000000000..a23b24ebd6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/core.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/core.js new file mode 100644 index 0000000000..2c94cb01fd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/core.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/core.js.map new file mode 100644 index 0000000000..68ea114aa9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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,CAAC,GAAG,OAAO,CAAC,aAAa,EAAE,WAAW,CAAC;QACzC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC5B,OAAO,UAAU,iBACf,QAAQ,EACR,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,WAAW,CAAC,IAC1C,OAAO,EACV,CAAC;AACL,CAAC;AAmDD,aAAa;AACb;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CACvB,QAA+B,EAC/B,aAAoC;IAEpC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,IAAI,UAAU,GAAG,QAAQ,CAAC;IAC1B,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,iBAAiB,EAAE;QACpC,MAAM,4BAA4B,GAAG,aAAa,CAAC,iBAAiB,CAAC,GAAG,CACtE,6BAA6B,CAC9B,CAAC;QACF,UAAU,GAAG,8BAA8B,CACzC,QAAQ,EACR,4BAA4B,CAC7B,CAAC;QACF,OAAO,GAAG,6BAA6B,CACrC,WAAW,EACX,4BAA4B,CAC7B,CAAC;KACH;IAED,wEAAwE;IACxE,2EAA2E;IAC3E,wEAAwE;IACxE,4EAA4E;IAC5E,4EAA4E;IAC5E,sEAAsE;IACtE,0CAA0C;IAC1C,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAC9C,CAAC;AAiCD;;;;;;;;GAQG;AACH,SAAS,6BAA6B,CACpC,gCAA8E;IAE9E,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,GAAG,gCAAgC,CAAC;IAE5E,MAAM,gBAAgB,GAAG,EAAE,CAAC;IAC5B,IAAI,OAAO,iBAAiB,KAAK,UAAU,EAAE;QAC3C,gBAAgB,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;KACjE;IACD,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;QACrC,gBAAgB,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;KAC3D;IACD,IAAI,gBAAgB,CAAC,MAAM,EAAE;QAC3B,MAAM,IAAI,SAAS,CACjB,yCAAyC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACxE,CAAC;KACH;IAED,OAAO;QACL,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,0BAA0B,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC1E,WAAW;KACZ,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,8BAA8B,CACrC,QAA+B,EAC/B,2BAGG;IAEH,OAAO,SAAS,kCAAkC,CAAC,IAAI;QACrD,MAAM,mCAAmC,GAAG,2BAA2B,CAAC,GAAG,CACzE,CAAC,iBAAiB,EAAE,EAAE,CACpB,4CAA4C,CAAC,iBAAiB,EAAE,IAAI,CAAC,CACxE,CAAC;QACF,OAAQ,QAA0C,CAAC,QAAQ,CACzD,IAAI,EACJ,mCAAmC,CACpC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAS,6BAA6B,CACpC,WAAwB,EACxB,2BAGG;IAEH,KAAK,UAAU,QAAQ,CAAC,IAAI;QAC1B,MAAM,mCAAmC,GAAG,2BAA2B,CAAC,GAAG,CACzE,CAAC,iBAAiB,EAAE,EAAE,CACpB,4CAA4C,CAAC,iBAAiB,EAAE,IAAI,CAAC,CACxE,CAAC;QAEF,iFAAiF;QACjF,iEAAiE;QACjE,4EAA4E;QAC5E,mFAAmF;QACnF,MAAM,OAAO,CAAC,GAAG,CACf,mCAAmC,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CACvD,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,CACpC,CACF,CAAC;QAEF,4EAA4E;QAC5E,MAAM,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,mCAAmC,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE;YACxE,uCAAuC;YACvC,MAAM,oBAAoB,GACxB,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YAErC,kEAAkE;YAClE,IAAI;gBACF,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;aACjD;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,KAAK,CACX,4EAA4E,CAC7E,CAAC;gBACF,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aAClB;YAED,iEAAiE;YACjE,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,YAAY,EAAE,CAAC;IAC1B,CAAC;IAED,SAAS,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO;QACnC,+EAA+E;QAC/E,8EAA8E;QAC9E,8EAA8E;QAC9E,+EAA+E;QAC/E,YAAY;QACZ,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;YACpD,MAAM,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAC1C,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,QAAQ;QACR,OAAO;KACR,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,4CAA4C,CACnD,0BAGC,EACD,IAAiB;IAEjB,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,0BAA0B,CAAC;IAChE,OAAO;QACL,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC;QAC3B,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts new file mode 100644 index 0000000000..301165fa8e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/index.js new file mode 100644 index 0000000000..f83307c7b1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/index.js.map new file mode 100644 index 0000000000..982c957a9a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts new file mode 100644 index 0000000000..e31c8b5a4b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js new file mode 100644 index 0000000000..68bbdadf3d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map new file mode 100644 index 0000000000..a4097ef8cb --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts new file mode 100644 index 0000000000..6f51eab82e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js new file mode 100644 index 0000000000..86ab763337 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map new file mode 100644 index 0000000000..c91fecd3c7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;KAC7B;AACH,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,sBAAsB;IAC7D,sBAAsB,CAAC,OAAO,CAC5B,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CACzE,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,SAAS,EAAE,sBAAsB;IACxE,sBAAsB,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAA;IACjF,MAAM,sBAAsB,CAAC,SAAS,CAAC,CAAA;AACzC,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,QAAQ;IACjD,OAAO,cAAc,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAA;AACnD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B;IAC9C,MAAM,WAAW,GAAG,MAAM,sBAAsB,CAAA;IAChD,wEAAwE;IACxE,8EAA8E;IAC9E,eAAe;IACf,iFAAiF;IACjF,6EAA6E;IAC7E,wFAAwF;IACxF,kFAAkF;IAClF,WAAW,CAAC,YAAY,EAAE,CAAA;IAC1B,6EAA6E;IAC7E,2DAA2D;IAC3D,WAAW,CAAC,aAAa,EAAE,CAAA;AAC7B,CAAC;AAED;;;GAGG;AACH,KAAK,UAAU,sBAAsB,CAAC,SAAS;IAC7C,MAAM,WAAW,GAAG,MAAM,sBAAsB,CAAA;IAEhD,MAAM,0BAA0B,GAAG,wBAAwB,CAAC,SAAS,CAAC,CAAA;IACtE,0BAA0B,CAAC,OAAO,CAChC,aAAa,CAAC,EAAE,CAAC,WAAW,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAC9D,CAAA;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,uBAAuB,CAAC,QAAQ;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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts new file mode 100644 index 0000000000..715b6d06a1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js new file mode 100644 index 0000000000..34f590b5d2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map new file mode 100644 index 0000000000..7940fcd972 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts new file mode 100644 index 0000000000..cf16c63f44 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js new file mode 100644 index 0000000000..13b2cdcc9b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map new file mode 100644 index 0000000000..f8ad3284bd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts new file mode 100644 index 0000000000..e6e0823a3e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts @@ -0,0 +1,2 @@ +export declare const mySpecialQuery: (queryCacheKey: string[], args: any) => Promise; +export { addMetadataToQuery } from './core'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js new file mode 100644 index 0000000000..d0238ee4f5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js @@ -0,0 +1,6 @@ +import { createQuery } from './core'; +// PUBLIC API +export const mySpecialQuery = createQuery('operations/my-special-query', ['User']); +// PRIVATE API +export { addMetadataToQuery } from './core'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map new file mode 100644 index 0000000000..271aa702f6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAGpC,aAAa;AACb,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CACvC,6BAA6B,EAC7B,CAAC,MAAM,CAAC,CACT,CAAA;AAED,cAAc;AACd,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts new file mode 100644 index 0000000000..40df1fa863 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js new file mode 100644 index 0000000000..9dfeab443f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map new file mode 100644 index 0000000000..82e2b19139 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts new file mode 100644 index 0000000000..fdccbcdfaa --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts @@ -0,0 +1,9 @@ +/// +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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/Link.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/Link.jsx new file mode 100644 index 0000000000..d38b7a9c65 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map new file mode 100644 index 0000000000..bb738bdad9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/index.d.ts new file mode 100644 index 0000000000..067b2fbd72 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/index.js new file mode 100644 index 0000000000..1a84b8d043 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/index.js.map new file mode 100644 index 0000000000..35eeff35e4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts new file mode 100644 index 0000000000..22fd81ec79 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js new file mode 100644 index 0000000000..144c9efc7c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map new file mode 100644 index 0000000000..064bcce597 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/types.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/types.d.ts new file mode 100644 index 0000000000..80d69a3452 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/types.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/types.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/router/types.js.map new file mode 100644 index 0000000000..7d60d60505 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/index.d.ts new file mode 100644 index 0000000000..b684c869ea --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/index.js new file mode 100644 index 0000000000..be0d1c7d5a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/index.js.map new file mode 100644 index 0000000000..33c10677b9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts new file mode 100644 index 0000000000..645112861a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx new file mode 100644 index 0000000000..fcc9fc0b7a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map new file mode 100644 index 0000000000..de41e60937 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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,CAAA;AAC3D,OAAO,EAAE,IAAI,EAA2C,MAAM,KAAK,CAAA;AACnE,OAAO,EAAE,WAAW,EAAoB,MAAM,UAAU,CAAA;AACxD,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAgB,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEvD,OAAO,MAAM,MAAM,kBAAkB,CAAA;AACrC,OAAO,EAAE,UAAU,EAAS,MAAM,aAAa,CAAA;AAW/C,aAAa;AACb,+CAA+C;AAC/C,sIAAsI;AACtI,MAAM,UAAU,eAAe,CAAC,EAAgB;IAC9C,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAA;IAChC,MAAM,KAA0B,MAAM,CACpC,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAClC;MAAA,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CACtB;IAAA,EAAE,mBAAmB,CAAC,CACvB,EAJK,EAAE,QAAQ,OAIf,EAJoB,MAAM,cAArB,YAAuB,CAI5B,CAAA;IACD,uCACK,MAAM,KACT,QAAQ,EAAE,CAAC,UAAwB,EAAE,EAAE,CACrC,QAAQ,CACN,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAClC;UAAA,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,EAAE,MAAM,CAC9B;QAAA,EAAE,mBAAmB,CAAC,CACvB,IACJ;AACH,CAAC;AAED,aAAa;AACb,MAAM,UAAU,UAAU;IAKxB,MAAM,MAAM,GAAgB,WAAW,EAAE,CAAA;IAEzC,SAAS,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;IAChC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,CAAC,aAAa,EAAE,CAAA;QACtB,OAAO,EAAE,CAAA;IACX,CAAC,CAAC,CAAA;IACF,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAA;IAE9B,MAAM,SAAS,GAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC/C,MAAM,KAAK,GAAI,KAAqC,CAAC,KAAK,CAAA;QAC1D,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAC1C,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC5C,CAAA;IACH,CAAC,CAAA;IAED,MAAM,OAAO,GAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC3C,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;IACvE,CAAC,CAAA;IAED,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAA;AACvC,CAAC;AAED,SAAS,SAAS,CAChB,MAAmB,EACnB,KAAY,EACZ,eAAwD;IAExD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;QACrD,MAAM,IAAI,KAAK,CACb,yCACE,KAAK,CAAC,MACR,mCAAmC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC3E,CAAA;KACF;IAED,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IAE3C,MAAM,QAAQ,GAAyD;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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.d.ts new file mode 100644 index 0000000000..86d9c078a1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.d.ts @@ -0,0 +1,14 @@ +/** + * Auth middleware + * + * If the request includes an `Authorization` header it will try to authenticate the request, + * otherwise it will let the request through. + * + * - If authentication succeeds it sets `req.sessionId` and `req.user` + * - `req.user` is the user that made the request and it's used in + * all Wasp features that need to know the user that made the request. + * - `req.sessionId` is the ID of the session that authenticated the request. + * - If the request is not authenticated, it throws an error. + */ +declare const auth: (req: any, res: Response, next: NextFunction) => Promise; +export default auth; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js new file mode 100644 index 0000000000..81da09ce67 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js @@ -0,0 +1,33 @@ +import { handleRejection } from 'wasp/server/utils'; +import { getSessionAndUserFromBearerToken } from 'wasp/auth/session'; +import { throwInvalidCredentialsError } from 'wasp/auth/utils'; +/** + * Auth middleware + * + * If the request includes an `Authorization` header it will try to authenticate the request, + * otherwise it will let the request through. + * + * - If authentication succeeds it sets `req.sessionId` and `req.user` + * - `req.user` is the user that made the request and it's used in + * all Wasp features that need to know the user that made the request. + * - `req.sessionId` is the ID of the session that authenticated the request. + * - If the request is not authenticated, it throws an error. + */ +const auth = handleRejection(async (req, res, next) => { + const authHeader = req.get('Authorization'); + if (!authHeader) { + // NOTE(matija): for now we let tokenless requests through and make it operation's + // responsibility to verify whether the request is authenticated or not. In the future + // we will develop our own system at Wasp-level for that. + return next(); + } + const { session, user } = await getSessionAndUserFromBearerToken(req); + if (!session || !user) { + throwInvalidCredentialsError(); + } + req.sessionId = session.id; + req.user = user; + next(); +}); +export default auth; +//# sourceMappingURL=auth.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js.map new file mode 100644 index 0000000000..2a4d43ebee --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../core/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAA;AAE9D;;;;;;;;;;;GAWG;AACH,MAAM,IAAI,GAAG,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;IACpD,MAAM,UAAU,GAAG,GAAG,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;IAC3C,IAAI,CAAC,UAAU,EAAE;QACf,kFAAkF;QAClF,sFAAsF;QACtF,yDAAyD;QACzD,OAAO,IAAI,EAAE,CAAA;KACd;IAED,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,MAAM,gCAAgC,CAAC,GAAG,CAAC,CAAC;IAEtE,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,EAAE;QACrB,4BAA4B,EAAE,CAAA;KAC/B;IAED,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,EAAE,CAAA;IAC1B,GAAG,CAAC,IAAI,GAAG,IAAI,CAAA;IAEf,IAAI,EAAE,CAAA;AACR,CAAC,CAAC,CAAA;AAEF,eAAe,IAAI,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/config.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/config.d.ts new file mode 100644 index 0000000000..b567b37b9a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/config.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/config.js new file mode 100644 index 0000000000..85d8f7e943 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/config.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/config.js.map new file mode 100644 index 0000000000..aa55beed81 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.d.ts new file mode 100644 index 0000000000..b0d46b2d39 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.d.ts @@ -0,0 +1,94 @@ +/// +export declare const styled: , Composers extends (string | import("@stitches/react/types/util").Function | import("react").ComponentType | { + [name: string]: unknown; +})[], CSS = import("@stitches/react/types/css-util").CSS<{}, { + colors: { + waspYellow: string; + gray700: string; + gray600: string; + gray500: string; + gray400: string; + red: string; + darkRed: string; + green: string; + brand: string; + brandAccent: string; + errorBackground: string; + errorText: string; + successBackground: string; + successText: string; + submitButtonText: string; + formErrorText: string; + }; + fontSizes: { + sm: string; + }; +}, import("@stitches/react/types/config").DefaultThemeMap, {}>>(type: Type, ...composers: { [K in keyof Composers]: string extends Composers[K] ? Composers[K] : Composers[K] extends string | import("@stitches/react/types/util").Function | import("react").ComponentType ? Composers[K] : import("@stitches/react/types/stitches").RemoveIndex & { + variants?: { + [x: string]: { + [x: string]: CSS; + [x: number]: CSS; + }; + }; + compoundVariants?: (("variants" extends keyof Composers[K] ? { [Name in keyof Composers[K][keyof Composers[K] & "variants"]]?: import("@stitches/react/types/util").String | import("@stitches/react/types/util").Widen; } : import("@stitches/react/types/util").WideObject) & { + css: CSS; + })[]; + defaultVariants?: "variants" extends keyof Composers[K] ? { [Name_1 in keyof Composers[K][keyof Composers[K] & "variants"]]?: import("@stitches/react/types/util").String | import("@stitches/react/types/util").Widen; } : import("@stitches/react/types/util").WideObject; +} & CSS & { [K2 in keyof Composers[K]]: K2 extends "compoundVariants" | "defaultVariants" | "variants" ? unknown : K2 extends keyof CSS ? CSS[K2] : unknown; }; }) => import("@stitches/react/types/styled-component").StyledComponent, {}, import("@stitches/react/types/css-util").CSS<{}, { + colors: { + waspYellow: string; + gray700: string; + gray600: string; + gray500: string; + gray400: string; + red: string; + darkRed: string; + green: string; + brand: string; + brandAccent: string; + errorBackground: string; + errorText: string; + successBackground: string; + successText: string; + submitButtonText: string; + formErrorText: string; + }; + fontSizes: { + sm: string; + }; +}, import("@stitches/react/types/config").DefaultThemeMap, {}>>, css: | import("react").JSXElementConstructor | { + [name: string]: unknown; +})[], CSS = import("@stitches/react/types/css-util").CSS<{}, { + colors: { + waspYellow: string; + gray700: string; + gray600: string; + gray500: string; + gray400: string; + red: string; + darkRed: string; + green: string; + brand: string; + brandAccent: string; + errorBackground: string; + errorText: string; + successBackground: string; + successText: string; + submitButtonText: string; + formErrorText: string; + }; + fontSizes: { + sm: string; + }; +}, import("@stitches/react/types/config").DefaultThemeMap, {}>>(...composers: { [K in keyof Composers]: string extends Composers[K] ? Composers[K] : Composers[K] extends string | import("@stitches/react/types/util").Function | import("react").ExoticComponent | import("react").JSXElementConstructor ? Composers[K] : import("@stitches/react/types/stitches").RemoveIndex & { + variants?: { + [x: string]: { + [x: string]: CSS; + [x: number]: CSS; + }; + }; + compoundVariants?: (("variants" extends keyof Composers[K] ? { [Name in keyof Composers[K][keyof Composers[K] & "variants"]]?: import("@stitches/react/types/util").String | import("@stitches/react/types/util").Widen; } : import("@stitches/react/types/util").WideObject) & { + css: CSS; + })[]; + defaultVariants?: "variants" extends keyof Composers[K] ? { [Name_1 in keyof Composers[K][keyof Composers[K] & "variants"]]?: import("@stitches/react/types/util").String | import("@stitches/react/types/util").Widen; } : import("@stitches/react/types/util").WideObject; +} & CSS & { [K2 in keyof Composers[K]]: K2 extends "compoundVariants" | "defaultVariants" | "variants" ? unknown : K2 extends keyof CSS ? CSS[K2] : unknown; }; }) => import("@stitches/react/types/styled-component").CssComponent, import("@stitches/react/types/styled-component").StyledComponentProps, {}, CSS>; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.js new file mode 100644 index 0000000000..57115b4e80 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.js @@ -0,0 +1,27 @@ +import { createStitches } from '@stitches/react'; +export const { styled, css } = createStitches({ + theme: { + colors: { + waspYellow: '#ffcc00', + gray700: '#a1a5ab', + gray600: '#d1d5db', + gray500: 'gainsboro', + gray400: '#f0f0f0', + red: '#FED7D7', + darkRed: '#fa3838', + green: '#C6F6D5', + brand: '$waspYellow', + brandAccent: '#ffdb46', + errorBackground: '$red', + errorText: '#2D3748', + successBackground: '$green', + successText: '#2D3748', + submitButtonText: 'black', + formErrorText: '$darkRed', + }, + fontSizes: { + sm: '0.875rem' + } + } +}); +//# sourceMappingURL=stitches.config.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.js.map new file mode 100644 index 0000000000..d8da9f6f46 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stitches.config.js","sourceRoot":"","sources":["../../core/stitches.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,MAAM,CAAC,MAAM,EACX,MAAM,EACN,GAAG,EACJ,GAAG,cAAc,CAAC;IACjB,KAAK,EAAE;QACL,MAAM,EAAE;YACN,UAAU,EAAE,SAAS;YACrB,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,SAAS;YAClB,GAAG,EAAE,SAAS;YACd,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,SAAS;YAEhB,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,SAAS;YACtB,eAAe,EAAE,MAAM;YACvB,SAAS,EAAE,SAAS;YACpB,iBAAiB,EAAE,QAAQ;YAC3B,WAAW,EAAE,SAAS;YAEtB,gBAAgB,EAAE,OAAO;YAEzB,aAAa,EAAE,UAAU;SAC1B;QACD,SAAS,EAAE;YACT,EAAE,EAAE,UAAU;SACf;KACF;CACF,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/storage.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/storage.d.ts new file mode 100644 index 0000000000..1beeea0400 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/storage.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/storage.js new file mode 100644 index 0000000000..e54cbb3c51 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/storage.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/storage.js.map new file mode 100644 index 0000000000..b7cd5db441 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/dev/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/dev/index.d.ts new file mode 100644 index 0000000000..14157874a1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/dev/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/dev/index.js new file mode 100644 index 0000000000..bd25589418 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/dev/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/dev/index.js.map new file mode 100644 index 0000000000..6874fe15b7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/entities/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/entities/index.d.ts new file mode 100644 index 0000000000..6b1fce51a1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/entities/index.d.ts @@ -0,0 +1,4 @@ +import { type User, type SocialLogin, type Task } from "@prisma/client"; +export { type User, type SocialLogin, type Task, type Auth, type AuthIdentity, } from "@prisma/client"; +export type Entity = User | SocialLogin | Task | never; +export type EntityName = "User" | "SocialLogin" | "Task" | never; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/entities/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/entities/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/entities/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/entities/index.js.map new file mode 100644 index 0000000000..28316c97d8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts new file mode 100644 index 0000000000..891990a1cc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx new file mode 100644 index 0000000000..1ecd86d313 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map new file mode 100644 index 0000000000..bc78a183b9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/App.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/App.d.ts new file mode 100644 index 0000000000..de3ec373f5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/App.d.ts @@ -0,0 +1,3 @@ +export default function App({ children }: { + children: any; +}): import("react").JSX.Element; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/App.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/App.jsx new file mode 100644 index 0000000000..6195916ceb --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/App.jsx @@ -0,0 +1,7 @@ +export default function App({ children }) { + return (
+

Root component

+ {children} +
); +} +//# sourceMappingURL=App.jsx.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/App.jsx.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/App.jsx.map new file mode 100644 index 0000000000..b3d8df611d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/App.jsx.map @@ -0,0 +1 @@ +{"version":3,"file":"App.jsx","sourceRoot":"","sources":["../../../ext-src/client/App.jsx"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE;IACtC,OAAO,CACL,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAClB;MAAA,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,CACtB;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/myClientSetupCode.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/myClientSetupCode.d.ts new file mode 100644 index 0000000000..05005c9810 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/myClientSetupCode.d.ts @@ -0,0 +1 @@ +export default function myClientSetupFunction(): void; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/myClientSetupCode.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/myClientSetupCode.js new file mode 100644 index 0000000000..c58d8b739a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/myClientSetupCode.js @@ -0,0 +1,4 @@ +export default function myClientSetupFunction() { + // Do some client setup here. +} +//# sourceMappingURL=myClientSetupCode.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/myClientSetupCode.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/myClientSetupCode.js.map new file mode 100644 index 0000000000..bb15b4a972 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/client/myClientSetupCode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"myClientSetupCode.js","sourceRoot":"","sources":["../../../ext-src/client/myClientSetupCode.js"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,qBAAqB;IAC3C,6BAA6B;AAC/B,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/actions/bar.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/actions/bar.d.ts new file mode 100644 index 0000000000..e4d9d9270c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/actions/bar.d.ts @@ -0,0 +1 @@ +export function foo(args: any): Promise; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/actions/bar.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/actions/bar.js new file mode 100644 index 0000000000..ebfeebd280 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/actions/bar.js @@ -0,0 +1,4 @@ +export const foo = async (args) => { + return 1; +}; +//# sourceMappingURL=bar.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/actions/bar.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/actions/bar.js.map new file mode 100644 index 0000000000..8e4c1cb7f9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/actions/bar.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bar.js","sourceRoot":"","sources":["../../../../ext-src/server/actions/bar.js"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,EAAE,IAAI,EAAE,EAAE;IAChC,OAAO,CAAC,CAAA;AACV,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apiNamespaces.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apiNamespaces.d.ts new file mode 100644 index 0000000000..e7e25c88a9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apiNamespaces.d.ts @@ -0,0 +1,2 @@ +import { MiddlewareConfigFn } from 'wasp/server'; +export declare const fooBarNamespaceMiddlewareFn: MiddlewareConfigFn; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apiNamespaces.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apiNamespaces.js new file mode 100644 index 0000000000..ba57fbdce9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apiNamespaces.js @@ -0,0 +1,4 @@ +export const fooBarNamespaceMiddlewareFn = (middlewareConfig) => { + return middlewareConfig; +}; +//# sourceMappingURL=apiNamespaces.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apiNamespaces.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apiNamespaces.js.map new file mode 100644 index 0000000000..539e0e94f9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apiNamespaces.js.map @@ -0,0 +1 @@ +{"version":3,"file":"apiNamespaces.js","sourceRoot":"","sources":["../../../ext-src/server/apiNamespaces.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,2BAA2B,GAAuB,CAAC,gBAAgB,EAAE,EAAE;IAClF,OAAO,gBAAgB,CAAA;AACzB,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apis.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apis.d.ts new file mode 100644 index 0000000000..a3f912b1c9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apis.d.ts @@ -0,0 +1,5 @@ +import { FooBar, FooBaz } from 'wasp/server/api'; +import { MiddlewareConfigFn } from 'wasp/server'; +export declare const fooBar: FooBar; +export declare const fooBaz: FooBaz; +export declare const fooBarMiddlewareFn: MiddlewareConfigFn; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apis.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apis.js new file mode 100644 index 0000000000..e1607cb7a3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apis.js @@ -0,0 +1,11 @@ +export const fooBar = (req, res, context) => { + res.set('Access-Control-Allow-Origin', '*'); + res.json({ msg: 'Hello, context.user.username!' }); +}; +export const fooBaz = (req, res, context) => { + res.json({ msg: 'Hello, stranger!' }); +}; +export const fooBarMiddlewareFn = (middlewareConfig) => { + return middlewareConfig; +}; +//# sourceMappingURL=apis.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apis.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apis.js.map new file mode 100644 index 0000000000..64bc649d65 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/apis.js.map @@ -0,0 +1 @@ +{"version":3,"file":"apis.js","sourceRoot":"","sources":["../../../ext-src/server/apis.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAW,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE;IAClD,GAAG,CAAC,GAAG,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAA;IAC3C,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,+BAA+B,EAAE,CAAC,CAAA;AACpD,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,MAAM,GAAW,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE;IAClD,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,kBAAkB,EAAE,CAAC,CAAA;AACvC,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,kBAAkB,GAAuB,CAAC,gBAAgB,EAAE,EAAE;IACzE,OAAO,gBAAgB,CAAA;AACzB,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.d.ts new file mode 100644 index 0000000000..e4d9d9270c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.d.ts @@ -0,0 +1 @@ +export function foo(args: any): Promise; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js new file mode 100644 index 0000000000..ebfeebd280 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js @@ -0,0 +1,4 @@ +export const foo = async (args) => { + return 1; +}; +//# sourceMappingURL=bar.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js.map new file mode 100644 index 0000000000..fc611e3a85 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bar.js","sourceRoot":"","sources":["../../../../ext-src/server/jobs/bar.js"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,EAAE,IAAI,EAAE,EAAE;IAChC,OAAO,CAAC,CAAA;AACV,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/returnHello.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/returnHello.d.ts new file mode 100644 index 0000000000..d16039435f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/returnHello.d.ts @@ -0,0 +1,4 @@ +import { ReturnHelloJob } from 'wasp/server/jobs'; +export declare const returnHello: ReturnHelloJob<{ + name: string; +}, string>; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/returnHello.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/returnHello.js new file mode 100644 index 0000000000..c346d1e4e1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/returnHello.js @@ -0,0 +1,4 @@ +export const returnHello = async (args) => { + return args.name; +}; +//# sourceMappingURL=returnHello.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/returnHello.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/returnHello.js.map new file mode 100644 index 0000000000..6c5d2edf3a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/returnHello.js.map @@ -0,0 +1 @@ +{"version":3,"file":"returnHello.js","sourceRoot":"","sources":["../../../../ext-src/server/jobs/returnHello.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,WAAW,GAA6C,KAAK,EAAE,IAAI,EAAE,EAAE;IAClF,OAAO,IAAI,CAAC,IAAI,CAAA;AAClB,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/myServerSetupCode.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/myServerSetupCode.d.ts new file mode 100644 index 0000000000..2333766f9f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/myServerSetupCode.d.ts @@ -0,0 +1 @@ +export default function mySetupFunction(): void; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/myServerSetupCode.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/myServerSetupCode.js new file mode 100644 index 0000000000..9375f81e67 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/myServerSetupCode.js @@ -0,0 +1,4 @@ +export default function mySetupFunction() { + // Do some server setup here. +} +//# sourceMappingURL=myServerSetupCode.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/myServerSetupCode.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/myServerSetupCode.js.map new file mode 100644 index 0000000000..603d323213 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/myServerSetupCode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"myServerSetupCode.js","sourceRoot":"","sources":["../../../ext-src/server/myServerSetupCode.js"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,eAAe;IACrC,6BAA6B;AAC/B,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/queries/bar.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/queries/bar.d.ts new file mode 100644 index 0000000000..e4d9d9270c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/queries/bar.d.ts @@ -0,0 +1 @@ +export function foo(args: any): Promise; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/queries/bar.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/queries/bar.js new file mode 100644 index 0000000000..ebfeebd280 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/queries/bar.js @@ -0,0 +1,4 @@ +export const foo = async (args) => { + return 1; +}; +//# sourceMappingURL=bar.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/queries/bar.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/queries/bar.js.map new file mode 100644 index 0000000000..da805c2789 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/server/queries/bar.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bar.js","sourceRoot":"","sources":["../../../../ext-src/server/queries/bar.js"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,EAAE,IAAI,EAAE,EAAE;IAChC,OAAO,CAAC,CAAA;AACV,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts new file mode 100644 index 0000000000..56b8d88eca --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js new file mode 100644 index 0000000000..3e216e57ce --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js.map new file mode 100644 index 0000000000..34064e924c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts new file mode 100644 index 0000000000..5ef849570f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts @@ -0,0 +1,41 @@ +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 User, type Auth, type AuthIdentity } from "wasp/entities"; +import { type EmailProviderData, type UsernameProviderData, type OAuthProviderData } from 'wasp/auth/utils'; +import { type _Entity } from "./taggedEntities"; +import { type Payload } from "./serialization"; +export * from "./taggedEntities"; +export * from "./serialization"; +export type Query = Operation; +export type Action = Operation; +export type AuthenticatedQuery = AuthenticatedOperation; +export type AuthenticatedAction = AuthenticatedOperation; +type AuthenticatedOperation = (args: Input, context: ContextWithUser) => Output | Promise; +export type AuthenticatedApi> = (req: Request, res: Response, context: ContextWithUser) => void; +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 = { + "User": typeof prisma.user; + "SocialLogin": typeof prisma.socialLogin; + "Task": typeof prisma.task; +}; +type Context = Expand<{ + entities: Expand>; +}>; +type ContextWithUser = Expand & { + user?: AuthUser; +}>; +export type DeserializedAuthIdentity = Expand & { + providerData: Omit | Omit | OAuthProviderData; +}>; +export type AuthUser = User & { + auth: Auth & { + identities: DeserializedAuthIdentity[]; + } | null; +}; +export type { ProviderName } from 'wasp/auth/utils'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/index.js new file mode 100644 index 0000000000..814a00a31f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/index.js.map new file mode 100644 index 0000000000..fccc395470 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/_types/index.ts"],"names":[],"mappings":"AAiBA,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts new file mode 100644 index 0000000000..8338115ad9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/serialization.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/serialization.js new file mode 100644 index 0000000000..085463a738 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map new file mode 100644 index 0000000000..4be6f7733a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts new file mode 100644 index 0000000000..1e72d72e8f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts @@ -0,0 +1,9 @@ +import { type Entity, type EntityName, type User, type SocialLogin, type Task } from 'wasp/entities'; +export type _User = WithName; +export type _SocialLogin = WithName; +export type _Task = WithName; +export type _Entity = _User | _SocialLogin | _Task | never; +type WithName = E & { + _entityName: Name; +}; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js new file mode 100644 index 0000000000..bf72aeef47 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map new file mode 100644 index 0000000000..d716981499 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/api/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/api/index.d.ts new file mode 100644 index 0000000000..d75bc1aee0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/api/index.d.ts @@ -0,0 +1,6 @@ +import { type ParamsDictionary as ExpressParams, type Query as ExpressQuery } from 'express-serve-static-core'; +import { type Api, type AuthenticatedApi } from '../_types'; +export type FooBar

= Record> = AuthenticatedApi<[ +], P, ResBody, ReqBody, ReqQuery, Locals>; +export type FooBaz

= Record> = Api<[ +], P, ResBody, ReqBody, ReqQuery, Locals>; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/api/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/api/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/api/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/api/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/api/index.js.map new file mode 100644 index 0000000000..0054a8d9e4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/api/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/api/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.d.ts new file mode 100644 index 0000000000..7c2a33ba59 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.d.ts @@ -0,0 +1,3 @@ +export { defineUserSignupFields, } from '../../auth/providers/types.js'; +export { createProviderId, sanitizeAndSerializeProviderData, updateAuthIdentityProviderData, deserializeAndSanitizeProviderData, findAuthIdentity, createUser, type ProviderId, type ProviderName, type EmailProviderData, type UsernameProviderData, type OAuthProviderData, } from '../../auth/utils.js'; +export { ensurePasswordIsPresent, ensureValidPassword, ensureTokenIsPresent, } from '../../auth/validation.js'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js new file mode 100644 index 0000000000..66289fd100 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js @@ -0,0 +1,4 @@ +export { defineUserSignupFields, } from '../../auth/providers/types.js'; +export { createProviderId, sanitizeAndSerializeProviderData, updateAuthIdentityProviderData, deserializeAndSanitizeProviderData, findAuthIdentity, createUser, } from '../../auth/utils.js'; +export { ensurePasswordIsPresent, ensureValidPassword, ensureTokenIsPresent, } from '../../auth/validation.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js.map new file mode 100644 index 0000000000..279d2fda3a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,GACvB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EACL,gBAAgB,EAChB,gCAAgC,EAChC,8BAA8B,EAC9B,kCAAkC,EAClC,gBAAgB,EAChB,UAAU,GAMX,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,0BAA0B,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.d.ts new file mode 100644 index 0000000000..623a32bd91 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.d.ts @@ -0,0 +1,18 @@ +type BaseConfig = { + allowedCORSOrigins: string | string[]; + auth: { + jwtSecret: string | undefined; + }; +}; +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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js new file mode 100644 index 0000000000..1a38557c02 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js @@ -0,0 +1,41 @@ +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: [], + auth: { + jwtSecret: undefined + } + }, + 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: '*', + auth: { + jwtSecret: 'DEVJWTSECRET' + } + }; +} +function getProductionConfig() { + const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); + return { + frontendUrl, + allowedCORSOrigins: [frontendUrl], + auth: { + jwtSecret: process.env.JWT_SECRET + } + }; +} +//# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js.map new file mode 100644 index 0000000000..9f40b26c5b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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;AA2BjD,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;QACtB,IAAI,EAAE;YACJ,SAAS,EAAE,SAAS;SACrB;KACF;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;QACvB,IAAI,EAAE;YACJ,SAAS,EAAE,cAAc;SAC1B;KACF,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;QACjC,IAAI,EAAE;YACJ,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;SAClC;KACF,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/index.d.ts new file mode 100644 index 0000000000..4bfb05721e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/index.d.ts @@ -0,0 +1 @@ +export type { tasks } from './tasks'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/index.js.map new file mode 100644 index 0000000000..db8bee59bf --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/crud/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.d.ts new file mode 100644 index 0000000000..4143c471a9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.d.ts @@ -0,0 +1,30 @@ +import type { AuthenticatedAction, AuthenticatedQuery, _Task } from "wasp/server/_types"; +import type { Prisma } from "@prisma/client"; +import { Payload } from "wasp/server/_types/serialization"; +import type { Task } from "wasp/entities"; +type _WaspEntityTagged = _Task; +type _WaspEntity = Task; +/** + * PUBLIC API + */ +export declare namespace tasks { + type GetAllQuery = AuthenticatedQuery<[_WaspEntityTagged], Input, Output>; + type GetQuery = AuthenticatedQuery<[_WaspEntityTagged], Input, Output>; + type CreateAction = AuthenticatedAction<[_WaspEntityTagged], Input, Output>; +} +/** + * PRIVATE API + * + * The types with the `Resolved` suffix are the types that are used internally by the Wasp client + * to implement full-stack type safety. + */ +type GetAllInput = {}; +type GetAllOutput = _WaspEntity[]; +export type GetAllQueryResolved = tasks.GetAllQuery; +type GetInput = Prisma.TaskWhereUniqueInput; +type GetOutput = _WaspEntity | null; +export type GetQueryResolved = tasks.GetQuery; +type CreateInput = Prisma.TaskCreateInput; +type CreateOutput = _WaspEntity; +export type CreateActionResolved = tasks.CreateAction; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.js new file mode 100644 index 0000000000..f08b21fec4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=tasks.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.js.map new file mode 100644 index 0000000000..c9ec55b148 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/crud/tasks.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../../server/crud/tasks.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts new file mode 100644 index 0000000000..dd6a8777b4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts @@ -0,0 +1,3 @@ +import Prisma from '@prisma/client'; +declare const dbClient: Prisma.PrismaClient; +export default dbClient; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.js new file mode 100644 index 0000000000..f5539f100c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.js @@ -0,0 +1,8 @@ +import Prisma from '@prisma/client'; +function createDbClient() { + return new Prisma.PrismaClient(); +} +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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.js.map new file mode 100644 index 0000000000..09af426ff3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/dbClient.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dbClient.js","sourceRoot":"","sources":["../../server/dbClient.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,gBAAgB,CAAA;AAEnC,SAAS,cAAc;IACrB,OAAO,IAAI,MAAM,CAAC,YAAY,EAAE,CAAA;AAClC,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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/helpers.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/helpers.d.ts new file mode 100644 index 0000000000..7f6ab36e38 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/helpers.d.ts @@ -0,0 +1,6 @@ +import { EmailFromField } from "./types"; +export declare function formatFromField({ email, name, }: { + email: string; + name?: string; +}): string; +export declare function getDefaultFromField(): EmailFromField; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/helpers.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/helpers.js new file mode 100644 index 0000000000..727b0f55c0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/helpers.js @@ -0,0 +1,18 @@ +// PRIVATE API +// Formats an email address and an optional name into a string that can be used +// as the "from" field in an email. +// { email: "test@test.com, name: "Test" } -> "Test " +export function formatFromField({ email, name, }) { + if (name) { + return `${name} <${email}>`; + } + return email; +} +// PRIVATE API +export function getDefaultFromField() { + return { + email: "hello@itsme.com", + name: "Hello", + }; +} +//# sourceMappingURL=helpers.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/helpers.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/helpers.js.map new file mode 100644 index 0000000000..5775d5cdc6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/helpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../server/email/core/helpers.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,+EAA+E;AAC/E,mCAAmC;AACnC,oEAAoE;AACpE,MAAM,UAAU,eAAe,CAAC,EAC9B,KAAK,EACL,IAAI,GAIL;IACC,IAAI,IAAI,EAAE;QACR,OAAO,GAAG,IAAI,KAAK,KAAK,GAAG,CAAC;KAC7B;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,cAAc;AACd,MAAM,UAAU,mBAAmB;IACjC,OAAO;QACL,KAAK,EAAE,iBAAiB;QACxB,IAAI,EAAE,OAAO;KACd,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/email/core/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/index.d.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/email/core/index.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/index.d.ts diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/index.js new file mode 100644 index 0000000000..5d0ef6ad22 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/index.js @@ -0,0 +1,3 @@ +// PRIVATE API +export { initSendGridEmailSender as initEmailSender } from "./providers/sendgrid.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/index.js.map new file mode 100644 index 0000000000..372dc9af8b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/email/core/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,OAAO,EAAE,uBAAuB,IAAI,eAAe,EAAE,MAAM,yBAAyB,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/providers/sendgrid.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/providers/sendgrid.d.ts new file mode 100644 index 0000000000..6a11c89483 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/providers/sendgrid.d.ts @@ -0,0 +1,2 @@ +import type { SendGridProvider, EmailSender } from "../types"; +export declare function initSendGridEmailSender(provider: SendGridProvider): EmailSender; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/providers/sendgrid.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/providers/sendgrid.js new file mode 100644 index 0000000000..8d16d95e6d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/providers/sendgrid.js @@ -0,0 +1,23 @@ +import SendGrid from "@sendgrid/mail"; +import { getDefaultFromField } from "../helpers.js"; +// PRIVATE API +export function initSendGridEmailSender(provider) { + SendGrid.setApiKey(provider.apiKey); + const defaultFromField = getDefaultFromField(); + return { + async send(email) { + const fromField = email.from || defaultFromField; + return SendGrid.send({ + from: { + email: fromField.email, + name: fromField.name, + }, + to: email.to, + subject: email.subject, + text: email.text, + html: email.html, + }); + }, + }; +} +//# sourceMappingURL=sendgrid.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/providers/sendgrid.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/providers/sendgrid.js.map new file mode 100644 index 0000000000..81c992a454 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/providers/sendgrid.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sendgrid.js","sourceRoot":"","sources":["../../../../../server/email/core/providers/sendgrid.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGpD,cAAc;AACd,MAAM,UAAU,uBAAuB,CACrC,QAA0B;IAE1B,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEpC,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IAE/C,OAAO;QACL,KAAK,CAAC,IAAI,CAAC,KAAK;YACd,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,IAAI,gBAAgB,CAAC;YACjD,OAAO,QAAQ,CAAC,IAAI,CAAC;gBACnB,IAAI,EAAE;oBACJ,KAAK,EAAE,SAAS,CAAC,KAAK;oBACtB,IAAI,EAAE,SAAS,CAAC,IAAI;iBACrB;gBACD,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,IAAI,EAAE,KAAK,CAAC,IAAI;aACjB,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/types.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/types.d.ts new file mode 100644 index 0000000000..30f5666643 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/types.d.ts @@ -0,0 +1,35 @@ +export type EmailProvider = SMTPEmailProvider | SendGridProvider | MailgunEmailProvider | DummyEmailProvider; +export type SMTPEmailProvider = { + type: "smtp"; + host: string; + port: number; + username: string; + password: string; +}; +export type SendGridProvider = { + type: "sendgrid"; + apiKey: string; +}; +export type MailgunEmailProvider = { + type: "mailgun"; + apiKey: string; + domain: string; +}; +export type DummyEmailProvider = { + type: "dummy"; +}; +export type EmailSender = { + send: (email: Email) => Promise; +}; +export type SentMessageInfo = any; +export type Email = { + from?: EmailFromField; + to: string; + subject: string; + text: string; + html: string; +}; +export type EmailFromField = { + name?: string; + email: string; +}; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/types.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/types.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/types.js.map new file mode 100644 index 0000000000..468fbb5c3a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../server/email/core/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.d.ts new file mode 100644 index 0000000000..e522ad16d6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.d.ts @@ -0,0 +1,2 @@ +export declare const emailSender: import("./core/types.js").EmailSender; +export type { Email, EmailFromField } from "./core/types.js"; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js new file mode 100644 index 0000000000..d837baecb7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js @@ -0,0 +1,8 @@ +import { initEmailSender } from "./core/index.js"; +const emailProvider = { + type: "sendgrid", + apiKey: process.env.SENDGRID_API_KEY, +}; +// PUBLIC API +export const emailSender = initEmailSender(emailProvider); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js.map new file mode 100644 index 0000000000..74b8993925 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/email/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,aAAa,GAAG;IACpB,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB;CAC5B,CAAC;AAEX,aAAa;AACb,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.d.ts new file mode 100644 index 0000000000..dee9613a53 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js new file mode 100644 index 0000000000..0e53e0deab --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js.map new file mode 100644 index 0000000000..b84ac1b303 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/job.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/job.d.ts new file mode 100644 index 0000000000..aa576c3c2b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/job.d.ts @@ -0,0 +1,19 @@ +/** + * This is a definition of a job (think draft or invocable computation), not the running instance itself. + * This can be submitted one or more times to be executed by some job executor via the same instance. + * Once submitted, you get a SubmittedJob to track it later. + */ +export declare class Job { + readonly jobName: string; + readonly executorName: string | symbol; + constructor(jobName: string, executorName: string | symbol); +} +/** + * This is the result of submitting a Job to some executor. + * It can be used by callers to track things, or call executor-specific subclass functionality. + */ +export declare class SubmittedJob { + readonly job: Job; + readonly jobId: string; + constructor(job: Job, jobId: string); +} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js new file mode 100644 index 0000000000..385a5c440d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js @@ -0,0 +1,22 @@ +/** + * This is a definition of a job (think draft or invocable computation), not the running instance itself. + * This can be submitted one or more times to be executed by some job executor via the same instance. + * Once submitted, you get a SubmittedJob to track it later. + */ +export class Job { + constructor(jobName, executorName) { + this.jobName = jobName; + this.executorName = executorName; + } +} +/** + * This is the result of submitting a Job to some executor. + * It can be used by callers to track things, or call executor-specific subclass functionality. + */ +export class SubmittedJob { + constructor(job, jobId) { + this.job = job; + this.jobId = jobId; + } +} +//# sourceMappingURL=job.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js.map new file mode 100644 index 0000000000..bb056f13aa --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js.map @@ -0,0 +1 @@ +{"version":3,"file":"job.js","sourceRoot":"","sources":["../../../../server/jobs/core/job.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,GAAG;IAId,YAAY,OAAe,EAAE,YAA6B;QACxD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,YAAY;IAIvB,YAAY,GAAQ,EAAE,KAAa;QACjC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.d.ts new file mode 100644 index 0000000000..602e9dccb1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.d.ts @@ -0,0 +1,3 @@ +export { type JobFn } from './types'; +export { registerJob, createJobDefinition } from './pgBossJob.js'; +export { startPgBoss } from './pgBoss.js'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js new file mode 100644 index 0000000000..6ac758e025 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js @@ -0,0 +1,3 @@ +export { registerJob, createJobDefinition } from './pgBossJob.js'; +export { startPgBoss } from './pgBoss.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js.map new file mode 100644 index 0000000000..46c6288b5e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../server/jobs/core/pgBoss/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.d.ts new file mode 100644 index 0000000000..d924442e43 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.d.ts @@ -0,0 +1,12 @@ +import PgBoss from 'pg-boss'; +export declare const pgBossStarted: Promise; +/** + * Prepares the target PostgreSQL database and begins job monitoring. + * If the required database objects do not exist in the specified database, + * `boss.start()` will automatically create them. + * Ref: https://github.com/timgit/pg-boss/blob/master/docs/readme.md#start + * + * After making this call, we can send pg-boss jobs and they will be persisted and acted upon. + * This should only be called once during a server's lifetime. + */ +export declare function startPgBoss(): Promise; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js new file mode 100644 index 0000000000..d1feb61aed --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js @@ -0,0 +1,67 @@ +import PgBoss from 'pg-boss'; +import { config } from 'wasp/server'; +const boss = createPgBoss(); +function createPgBoss() { + let pgBossNewOptions = { + connectionString: config.databaseUrl, + }; + // Add an escape hatch for advanced configuration of pg-boss to overwrite our defaults. + if (process.env.PG_BOSS_NEW_OPTIONS) { + try { + pgBossNewOptions = JSON.parse(process.env.PG_BOSS_NEW_OPTIONS); + } + catch (_a) { + console.error('Environment variable PG_BOSS_NEW_OPTIONS was not parsable by JSON.parse()!'); + } + } + return new PgBoss(pgBossNewOptions); +} +let resolvePgBossStarted; +let rejectPgBossStarted; +// PRIVATE API +// Code that wants to access pg-boss must wait until it has been started. +export const pgBossStarted = new Promise((resolve, reject) => { + resolvePgBossStarted = resolve; + rejectPgBossStarted = reject; +}); +var PgBossStatus; +(function (PgBossStatus) { + PgBossStatus["Unstarted"] = "Unstarted"; + PgBossStatus["Starting"] = "Starting"; + PgBossStatus["Started"] = "Started"; + PgBossStatus["Error"] = "Error"; +})(PgBossStatus || (PgBossStatus = {})); +let pgBossStatus = PgBossStatus.Unstarted; +// PRIVATE API +/** + * Prepares the target PostgreSQL database and begins job monitoring. + * If the required database objects do not exist in the specified database, + * `boss.start()` will automatically create them. + * Ref: https://github.com/timgit/pg-boss/blob/master/docs/readme.md#start + * + * After making this call, we can send pg-boss jobs and they will be persisted and acted upon. + * This should only be called once during a server's lifetime. + */ +export async function startPgBoss() { + // Ensure pg-boss can only be started once during a server's lifetime. + if (pgBossStatus !== PgBossStatus.Unstarted) { + return; + } + pgBossStatus = PgBossStatus.Starting; + console.log('Starting pg-boss...'); + boss.on('error', (error) => console.error(error)); + try { + await boss.start(); + } + catch (error) { + console.error('pg-boss failed to start!'); + console.error(error); + pgBossStatus = PgBossStatus.Error; + rejectPgBossStarted(boss); + return; + } + resolvePgBossStarted(boss); + console.log('pg-boss started!'); + pgBossStatus = PgBossStatus.Started; +} +//# sourceMappingURL=pgBoss.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map new file mode 100644 index 0000000000..6db706ac2b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pgBoss.js","sourceRoot":"","sources":["../../../../../server/jobs/core/pgBoss/pgBoss.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,MAAM,IAAI,GAAG,YAAY,EAAE,CAAA;AAE3B,SAAS,YAAY;IACnB,IAAI,gBAAgB,GAAG;QACrB,gBAAgB,EAAE,MAAM,CAAC,WAAW;KACrC,CAAA;IAED,uFAAuF;IACvF,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE;QACnC,IAAI;YACF,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;SAC/D;QAAC,WAAM;YACN,OAAO,CAAC,KAAK,CACX,4EAA4E,CAC7E,CAAA;SACF;KACF;IAED,OAAO,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAA;AACrC,CAAC;AAED,IAAI,oBAA4C,CAAA;AAChD,IAAI,mBAA2C,CAAA;AAC/C,cAAc;AACd,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IACnE,oBAAoB,GAAG,OAAO,CAAA;IAC9B,mBAAmB,GAAG,MAAM,CAAA;AAC9B,CAAC,CAAC,CAAA;AAEF,IAAK,YAKJ;AALD,WAAK,YAAY;IACf,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;AACjB,CAAC,EALI,YAAY,KAAZ,YAAY,QAKhB;AAED,IAAI,YAAY,GAAiB,YAAY,CAAC,SAAS,CAAA;AAEvD,cAAc;AACd;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,sEAAsE;IACtE,IAAI,YAAY,KAAK,YAAY,CAAC,SAAS,EAAE;QAC3C,OAAM;KACP;IACD,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAA;IACpC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;IAElC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;IACjD,IAAI;QACF,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;KACnB;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAA;QACzC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACpB,YAAY,GAAG,YAAY,CAAC,KAAK,CAAA;QACjC,mBAAmB,CAAC,IAAI,CAAC,CAAA;QACzB,OAAM;KACP;IAED,oBAAoB,CAAC,IAAI,CAAC,CAAA;IAE1B,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;IAC/B,YAAY,GAAG,YAAY,CAAC,OAAO,CAAA;AACrC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts new file mode 100644 index 0000000000..daf1c7f9d0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts @@ -0,0 +1,71 @@ +import PgBoss from 'pg-boss'; +import { Job, SubmittedJob } from '../job.js'; +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization'; +import { PrismaDelegate } from 'wasp/server/_types'; +import type { JobFn } from 'wasp/server/jobs/core/pgBoss'; +export declare const PG_BOSS_EXECUTOR_NAME: unique symbol; +type JobSchedule = { + cron: Parameters[1]; + args: Parameters[2]; + options: Parameters[3]; +}; +/** + * Creates an instance of PgBossJob which contains all of the necessary + * information to submit a job to pg-boss. + */ +export declare function createJobDefinition>({ jobName, defaultJobOptions, jobSchedule, entities, }: { + jobName: Parameters[0]; + defaultJobOptions: PgBoss.Schedule['options']; + jobSchedule: JobSchedule | null; + entities: Entities; +}): PgBossJob; +/** + * Uses the info about a job in PgBossJob to register a user defined job handler with pg-boss. + * We expect this to be called once per job name. If called multiple times with the same name and different + * functions, we will override the previous calls. + */ +export declare function registerJob>({ job, jobFn }: { + job: PgBossJob; + jobFn: JobFn; +}): void; +/** + * This is an interface repesenting a job that can be submitted to pg-boss. + * It is not yet submitted until the caller invokes `submit()` on an instance. + * The caller can make as many calls to `submit()` as they wish. + */ +declare class PgBossJob> extends Job { + readonly defaultJobOptions: Parameters[2]; + readonly startAfter: number | string | Date; + readonly entities: Entities; + readonly jobSchedule: JobSchedule | null; + constructor(jobName: string, defaultJobOptions: Parameters[2], entities: Entities, jobSchedule: JobSchedule | null, startAfter?: number | string | Date); + delay(startAfter: number | string | Date): PgBossJob; + submit(jobArgs: Input, jobOptions?: Parameters[2]): Promise>; +} +/** + * A pg-boss specific SubmittedJob that adds additional pg-boss functionality. + */ +declare class PgBossSubmittedJob> extends SubmittedJob { + readonly pgBoss: { + readonly cancel: () => ReturnType; + readonly resume: () => ReturnType; + readonly details: () => Promise | null>; + }; + constructor(boss: PgBoss, job: PgBossJob, jobId: SubmittedJob['jobId']); +} +type PgBossDetails = Omit, 'state' | 'output'> & { + data: Input; +} & ({ + state: 'completed'; + output: JobOutputToMetadataOutput; +} | { + state: 'failed'; + output: object; +} | { + state: 'created' | 'retry' | 'active' | 'expired' | 'cancelled'; + output: null; +}); +type JobOutputToMetadataOutput = JobOutput extends null | undefined | void | Function ? null : JobOutput extends object ? JobOutput : { + value: JobOutput; +}; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js new file mode 100644 index 0000000000..e26ad6250d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js @@ -0,0 +1,93 @@ +import { pgBossStarted } from './pgBoss.js'; +import { Job, SubmittedJob } from '../job.js'; +export const PG_BOSS_EXECUTOR_NAME = Symbol('PgBoss'); +// PRIVATE API +/** + * Creates an instance of PgBossJob which contains all of the necessary + * information to submit a job to pg-boss. + */ +export function createJobDefinition({ jobName, defaultJobOptions, jobSchedule, entities, }) { + return new PgBossJob(jobName, defaultJobOptions, entities, jobSchedule); +} +// PRIVATE API +/** + * Uses the info about a job in PgBossJob to register a user defined job handler with pg-boss. + * We expect this to be called once per job name. If called multiple times with the same name and different + * functions, we will override the previous calls. + */ +export function registerJob({ job, jobFn }) { + // NOTE(shayne): We are not awaiting `pgBossStarted` here since we need to return an instance to the job + // template, or else the NodeJS module bootstrapping process will block and fail as it would then depend + // on a runtime resolution of the promise in `startServer()`. + // Since `pgBossStarted` will resolve in the future, it may appear possible to send pg-boss + // a job before we actually have registered the handler via `boss.work()`. However, even if NodeJS does + // not execute this callback before any job `submit()` calls, this is not a problem since pg-boss allows you + // to submit jobs even if there are no workers registered. + // Once they are registered, they will just start on the first job in their queue. + pgBossStarted.then(async (boss) => { + // As a safety precaution against undefined behavior of registering different + // functions for the same job name, remove all registered functions first. + await boss.offWork(job.jobName); + // This tells pg-boss to run given worker function when job with that name is submitted. + // Ref: https://github.com/timgit/pg-boss/blob/master/docs/readme.md#work + await boss.work(job.jobName, pgBossCallbackWrapper(jobFn, job.entities)); + // If a job schedule is provided, we should schedule the recurring job. + // If the schedule name already exists, it's updated to the provided cron expression, arguments, and options. + // Ref: https://github.com/timgit/pg-boss/blob/master/docs/readme.md#scheduling + if (job.jobSchedule) { + const options = Object.assign(Object.assign({}, job.defaultJobOptions), job.jobSchedule.options); + await boss.schedule(job.jobName, job.jobSchedule.cron, job.jobSchedule.args || null, options); + } + }); +} +/** + * This is an interface repesenting a job that can be submitted to pg-boss. + * It is not yet submitted until the caller invokes `submit()` on an instance. + * The caller can make as many calls to `submit()` as they wish. + */ +class PgBossJob extends Job { + constructor(jobName, defaultJobOptions, entities, jobSchedule, startAfter) { + super(jobName, PG_BOSS_EXECUTOR_NAME); + this.defaultJobOptions = defaultJobOptions; + this.entities = entities; + this.jobSchedule = jobSchedule; + this.startAfter = startAfter; + } + delay(startAfter) { + return new PgBossJob(this.jobName, this.defaultJobOptions, this.entities, this.jobSchedule, startAfter); + } + async submit(jobArgs, jobOptions = {}) { + const boss = await pgBossStarted; + const jobId = await boss.send(this.jobName, jobArgs, Object.assign(Object.assign(Object.assign({}, this.defaultJobOptions), (this.startAfter && { startAfter: this.startAfter })), jobOptions)); + return new PgBossSubmittedJob(boss, this, jobId); + } +} +/** + * A pg-boss specific SubmittedJob that adds additional pg-boss functionality. + */ +class PgBossSubmittedJob extends SubmittedJob { + constructor(boss, job, jobId) { + super(job, jobId); + this.pgBoss = { + cancel: () => boss.cancel(jobId), + resume: () => boss.resume(jobId), + // Coarcing here since pg-boss typings are not precise enough. + details: () => boss.getJobById(jobId), + }; + } +} +/** + * Wraps the normal pg-boss callback function to inject entities, as well as extract + * the `data` property so the arguments passed into the job are the exact same as those received. + */ +function pgBossCallbackWrapper( +// jobFn - The user-defined async job callback function. +jobFn, +// Entities used by job, passed into callback context. +entities) { + return (args) => { + const context = { entities }; + return jobFn(args.data, context); + }; +} +//# sourceMappingURL=pgBossJob.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map new file mode 100644 index 0000000000..4b8eb79a28 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pgBossJob.js","sourceRoot":"","sources":["../../../../../server/jobs/core/pgBoss/pgBossJob.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAK7C,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAQrD,cAAc;AACd;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAIjC,EACA,OAAO,EACP,iBAAiB,EACjB,WAAW,EACX,QAAQ,GAUT;IACC,OAAO,IAAI,SAAS,CAClB,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,WAAW,CACZ,CAAA;AACH,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAIzB,EAAE,GAAG,EAAE,KAAK,EAGb;IACC,wGAAwG;IACxG,wGAAwG;IACxG,6DAA6D;IAC7D,2FAA2F;IAC3F,uGAAuG;IACvG,4GAA4G;IAC5G,0DAA0D;IAC1D,kFAAkF;IAClF,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAChC,6EAA6E;QAC7E,0EAA0E;QAC1E,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAE/B,wFAAwF;QACxF,yEAAyE;QACzE,MAAM,IAAI,CAAC,IAAI,CACb,GAAG,CAAC,OAAO,EACX,qBAAqB,CAA0B,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC,CACpE,CAAA;QAED,uEAAuE;QACvE,6GAA6G;QAC7G,+EAA+E;QAC/E,IAAI,GAAG,CAAC,WAAW,EAAE;YACnB,MAAM,OAAO,mCACR,GAAG,CAAC,iBAAiB,GACrB,GAAG,CAAC,WAAW,CAAC,OAAO,CAC3B,CAAA;YACD,MAAM,IAAI,CAAC,QAAQ,CACjB,GAAG,CAAC,OAAO,EACX,GAAG,CAAC,WAAW,CAAC,IAAI,EACpB,GAAG,CAAC,WAAW,CAAC,IAAI,IAAI,IAAI,EAC5B,OAAO,CACR,CAAA;SACF;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,SAIJ,SAAQ,GAAG;IAMX,YACE,OAAe,EACf,iBAAgD,EAChD,QAAkB,EAClB,WAA+B,EAC/B,UAAmC;QAEnC,KAAK,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAA;QACrC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAA;QAC1C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;IACD,KAAK,CAAC,UAAkC;QACtC,OAAO,IAAI,SAAS,CAClB,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,iBAAiB,EACtB,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,WAAW,EAChB,UAAU,CACX,CAAA;IACH,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAAc,EAAE,aAA4C,EAAE;QACzE,MAAM,IAAI,GAAG,MAAM,aAAa,CAAA;QAChC,MAAM,KAAK,GAAG,MAAO,IAAI,CAAC,IAAY,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,gDACvD,IAAI,CAAC,iBAAiB,GACtB,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,GACpD,UAAU,EACb,CAAA;QACF,OAAO,IAAI,kBAAkB,CAA0B,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;IAC3E,CAAC;CACF;AAED;;GAEG;AACH,MAAM,kBAIJ,SAAQ,YAAY;IAOpB,YACE,IAAY,EACZ,GAAuC,EACvC,KAA4B;QAE5B,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QACjB,IAAI,CAAC,MAAM,GAAG;YACZ,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YAChC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YAChC,8DAA8D;YAC9D,OAAO,EAAE,GAAG,EAAE,CACZ,IAAI,CAAC,UAAU,CAAC,KAAK,CAAiD;SACzE,CAAA;IACH,CAAC;CACF;AAED;;;GAGG;AACH,SAAS,qBAAqB;AAK5B,wDAAwD;AACxD,KAAqC;AACrC,sDAAsD;AACtD,QAAkB;IAElB,OAAO,CAAC,IAAqB,EAAE,EAAE;QAC/B,MAAM,OAAO,GAAG,EAAE,QAAQ,EAAE,CAAA;QAC5B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAClC,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.d.ts new file mode 100644 index 0000000000..972df20e0c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.d.ts @@ -0,0 +1,5 @@ +import { PrismaDelegate } from 'wasp/server/_types'; +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization'; +export type JobFn> = (data: Input, context: { + entities: Entities; +}) => Promise; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js.map new file mode 100644 index 0000000000..3e9bb733a3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../server/jobs/core/pgBoss/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/index.d.ts new file mode 100644 index 0000000000..c49368419d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/index.d.ts @@ -0,0 +1,2 @@ +export { type MySpecialJob, mySpecialJob } from './mySpecialJob.js'; +export { type ReturnHelloJob, returnHelloJob } from './returnHelloJob.js'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/index.js new file mode 100644 index 0000000000..408ca8d05e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/index.js @@ -0,0 +1,3 @@ +export { mySpecialJob } from './mySpecialJob.js'; +export { returnHelloJob } from './returnHelloJob.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/index.js.map new file mode 100644 index 0000000000..9aef001f73 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/jobs/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACnE,OAAO,EAAuB,cAAc,EAAE,MAAM,qBAAqB,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts new file mode 100644 index 0000000000..4f9f5b1763 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts @@ -0,0 +1,46 @@ +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization'; +import { type JobFn } from 'wasp/server/jobs/core/pgBoss'; +declare const entities: {}; +export type MySpecialJob = JobFn; +export declare const mySpecialJob: { + readonly defaultJobOptions: import("pg-boss").SendOptions; + readonly startAfter: string | number | Date; + readonly entities: {}; + readonly jobSchedule: { + cron: string; + args: object; + options: import("pg-boss").ScheduleOptions; + }; + delay(startAfter: string | number | Date): any; + submit(jobArgs: JSONObject, jobOptions?: import("pg-boss").SendOptions): Promise<{ + readonly pgBoss: { + readonly cancel: () => Promise; + readonly resume: () => Promise; + readonly details: () => Promise, "output" | "state"> & { + data: JSONObject; + } & ({ + state: "failed"; + output: object; + } | { + state: "retry" | "created" | "active" | "expired" | "cancelled"; + output: null; + } | { + state: "completed"; + output: import("wasp/server/_types/serialization").JSONArray | JSONObject | { + value: string; + } | { + value: number; + } | { + value: false; + } | { + value: true; + }; + })>; + }; + readonly job: import("./core/job").Job; + readonly jobId: string; + }>; + readonly jobName: string; + readonly executorName: string | symbol; +}; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js new file mode 100644 index 0000000000..f8de946894 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js @@ -0,0 +1,10 @@ +import { createJobDefinition } from 'wasp/server/jobs/core/pgBoss'; +const entities = {}; +// PUBLIC API +export const mySpecialJob = createJobDefinition({ + jobName: 'mySpecialJob', + defaultJobOptions: {}, + jobSchedule: null, + entities, +}); +//# sourceMappingURL=mySpecialJob.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map new file mode 100644 index 0000000000..4ae829e30f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mySpecialJob.js","sourceRoot":"","sources":["../../../server/jobs/mySpecialJob.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAE9E,MAAM,QAAQ,GAAG,EAChB,CAAA;AAKD,aAAa;AACb,MAAM,CAAC,MAAM,YAAY,GAAG,mBAAmB,CAAC;IAC9C,OAAO,EAAE,cAAc;IACvB,iBAAiB,EAAE,EAAE;IACrB,WAAW,EAAE,IAAI;IACjB,QAAQ;CACT,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.d.ts new file mode 100644 index 0000000000..8d6814af9d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.d.ts @@ -0,0 +1,50 @@ +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization'; +import { type JobFn } from 'wasp/server/jobs/core/pgBoss'; +declare const entities: { + User: import(".prisma/client").Prisma.UserDelegate; +}; +export type ReturnHelloJob = JobFn; +export declare const returnHelloJob: { + readonly defaultJobOptions: import("pg-boss").SendOptions; + readonly startAfter: string | number | Date; + readonly entities: { + User: import(".prisma/client").Prisma.UserDelegate; + }; + readonly jobSchedule: { + cron: string; + args: object; + options: import("pg-boss").ScheduleOptions; + }; + delay(startAfter: string | number | Date): any; + submit(jobArgs: JSONObject, jobOptions?: import("pg-boss").SendOptions): Promise<{ + readonly pgBoss: { + readonly cancel: () => Promise; + readonly resume: () => Promise; + readonly details: () => Promise, "output" | "state"> & { + data: JSONObject; + } & ({ + state: "failed"; + output: object; + } | { + state: "retry" | "created" | "active" | "expired" | "cancelled"; + output: null; + } | { + state: "completed"; + output: import("wasp/server/_types/serialization").JSONArray | JSONObject | { + value: string; + } | { + value: number; + } | { + value: false; + } | { + value: true; + }; + })>; + }; + readonly job: import("./core/job").Job; + readonly jobId: string; + }>; + readonly jobName: string; + readonly executorName: string | symbol; +}; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js new file mode 100644 index 0000000000..02e6f71fb6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js @@ -0,0 +1,13 @@ +import { prisma } from 'wasp/server'; +import { createJobDefinition } from 'wasp/server/jobs/core/pgBoss'; +const entities = { + User: prisma.user, +}; +// PUBLIC API +export const returnHelloJob = createJobDefinition({ + jobName: 'returnHelloJob', + defaultJobOptions: {}, + jobSchedule: null, + entities, +}); +//# sourceMappingURL=returnHelloJob.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js.map new file mode 100644 index 0000000000..6aed6d65d0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js.map @@ -0,0 +1 @@ +{"version":3,"file":"returnHelloJob.js","sourceRoot":"","sources":["../../../server/jobs/returnHelloJob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,EAAc,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAE9E,MAAM,QAAQ,GAAG;IACf,IAAI,EAAE,MAAM,CAAC,IAAI;CAClB,CAAA;AAKD,aAAa;AACb,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAAC;IAChD,OAAO,EAAE,gBAAgB;IACzB,iBAAiB,EAAE,EAAE;IACrB,WAAW,EAAE,IAAI;IACjB,QAAQ;CACT,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts new file mode 100644 index 0000000000..617cac8a78 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js new file mode 100644 index 0000000000..0926cba3d4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map new file mode 100644 index 0000000000..0490e6f7e3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts new file mode 100644 index 0000000000..4204eb294c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts @@ -0,0 +1 @@ +export * from './globalMiddleware.js'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/index.js new file mode 100644 index 0000000000..db90d2875a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map new file mode 100644 index 0000000000..23374314b8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts new file mode 100644 index 0000000000..31413a8f26 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts @@ -0,0 +1,3 @@ +import { foo as foo_ext } from 'wasp/ext-src/server/actions/bar.js'; +export type MySpecialAction = typeof foo_ext; +export declare const mySpecialAction: (args: any, context: any) => Promise; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js new file mode 100644 index 0000000000..615a165292 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js @@ -0,0 +1,9 @@ +import { prisma } from 'wasp/server'; +import { foo as foo_ext } from 'wasp/ext-src/server/actions/bar.js'; +// PUBLIC API +export const mySpecialAction = async (args, context) => { + return foo_ext(args, Object.assign(Object.assign({}, context), { entities: { + User: prisma.user, + } })); +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map new file mode 100644 index 0000000000..722f695916 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAKnE,aAAa;AACb,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IACrD,OAAQ,OAAe,CAAC,IAAI,kCACvB,OAAO,KACV,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,IACD,CAAA;AACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts new file mode 100644 index 0000000000..9fe2d328b2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts @@ -0,0 +1,4 @@ +import { type _User, type AuthenticatedAction, type Payload } from 'wasp/server/_types'; +export type MySpecialAction = AuthenticatedAction<[ + _User +], Input, Output>; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map new file mode 100644 index 0000000000..43367cc658 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts new file mode 100644 index 0000000000..440789aefa --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts @@ -0,0 +1,4 @@ +export * from './queries/types.js'; +export * from './actions/types.js'; +export { mySpecialQuery } from './queries/index.js'; +export { mySpecialAction } from './actions/index.js'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/index.js new file mode 100644 index 0000000000..ee6bc8ca31 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/index.js @@ -0,0 +1,7 @@ +// PUBLIC API +export * from './queries/types.js'; +// PUBLIC API +export * from './actions/types.js'; +export { mySpecialQuery } from './queries/index.js'; +export { mySpecialAction } from './actions/index.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/index.js.map new file mode 100644 index 0000000000..5a4d2c8974 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts new file mode 100644 index 0000000000..41c767c8c2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts @@ -0,0 +1,3 @@ +import { foo as foo_ext } from 'wasp/ext-src/server/queries/bar.js'; +export type MySpecialQuery = typeof foo_ext; +export declare const mySpecialQuery: (args: any, context: any) => Promise; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js new file mode 100644 index 0000000000..f8c452da55 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js @@ -0,0 +1,9 @@ +import { prisma } from 'wasp/server'; +import { foo as foo_ext } from 'wasp/ext-src/server/queries/bar.js'; +// PUBLIC API +export const mySpecialQuery = async (args, context) => { + return foo_ext(args, Object.assign(Object.assign({}, context), { entities: { + User: prisma.user, + } })); +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map new file mode 100644 index 0000000000..1588bf6275 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAKnE,aAAa;AACb,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IACpD,OAAQ,OAAe,CAAC,IAAI,kCACvB,OAAO,KACV,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,IACD,CAAA;AACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts new file mode 100644 index 0000000000..eef9339da4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts @@ -0,0 +1,4 @@ +import { type _User, type AuthenticatedQuery, type Payload } from 'wasp/server/_types'; +export type MySpecialQuery = AuthenticatedQuery<[ + _User +], Input, Output>; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map new file mode 100644 index 0000000000..c4eb8778e7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/types/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/types/index.d.ts new file mode 100644 index 0000000000..ce2e8cb99c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/types/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/types/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/types/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/types/index.js.map new file mode 100644 index 0000000000..4ab1f1d596 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.d.ts new file mode 100644 index 0000000000..1fde6136f1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.d.ts @@ -0,0 +1,16 @@ +import { Request, Response, NextFunction } from 'express'; +import { type AuthUser } from 'wasp/auth'; +type RequestWithExtraFields = Request & { + user?: AuthUser; + sessionId?: string; +}; +/** + * 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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.js new file mode 100644 index 0000000000..9b2034006b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.js.map new file mode 100644 index 0000000000..3239be7b10 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../server/utils.ts"],"names":[],"mappings":"AAcA;;;;;;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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.d.ts new file mode 100644 index 0000000000..14dd465dca --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.js.map new file mode 100644 index 0000000000..8c06b33e94 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.d.ts new file mode 100644 index 0000000000..aa893e7838 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.js new file mode 100644 index 0000000000..988c0a67aa --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.js.map new file mode 100644 index 0000000000..a7bad96020 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/validators.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/validators.d.ts new file mode 100644 index 0000000000..bd179246a1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/web-app/scripts/universal/validators.mjs b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/validators.js similarity index 91% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/scripts/universal/validators.mjs rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/validators.js index 9e3605d3b5..53462b3932 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/scripts/universal/validators.mjs +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/validators.js @@ -9,13 +9,14 @@ export function isValidAbsoluteURL(rawUrl) { "localhost:" and host of "3000" */ return url.protocol === "http:" || url.protocol === "https:"; - } catch (e) { + } + 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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/validators.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/validators.js.map new file mode 100644 index 0000000000..313c98cef4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/entities/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/entities/index.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/entities/index.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/entities/index.ts diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/Main.css b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/Main.css similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/Main.css rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/Main.css diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/MainPage.jsx new file mode 100644 index 0000000000..01aae7c3db --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/App.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/client/App.jsx similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/App.jsx rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/client/App.jsx diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/myClientSetupCode.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/client/myClientSetupCode.js similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/myClientSetupCode.js rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/client/myClientSetupCode.js diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/ext-src/actions/bar.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/actions/bar.js similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/ext-src/actions/bar.js rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/actions/bar.js diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/ext-src/apiNamespaces.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/apiNamespaces.ts similarity index 69% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/ext-src/apiNamespaces.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/apiNamespaces.ts index 77dd63228a..e44a461b4b 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/ext-src/apiNamespaces.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/apiNamespaces.ts @@ -1,4 +1,4 @@ -import { MiddlewareConfigFn } from '../middleware' +import { MiddlewareConfigFn } from 'wasp/server' export const fooBarNamespaceMiddlewareFn: MiddlewareConfigFn = (middlewareConfig) => { return middlewareConfig } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/ext-src/apis.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/apis.ts similarity index 78% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/ext-src/apis.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/apis.ts index 41ab73c1f6..04d497415a 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/ext-src/apis.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/apis.ts @@ -1,5 +1,5 @@ -import { FooBar, FooBaz } from '../apis/types' -import { MiddlewareConfigFn } from '../middleware' +import { FooBar, FooBaz } from 'wasp/server/api' +import { MiddlewareConfigFn } from 'wasp/server' export const fooBar: FooBar = (req, res, context) => { res.set('Access-Control-Allow-Origin', '*') res.json({ msg: 'Hello, context.user.username!' }) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/ext-src/jobs/bar.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/jobs/bar.js similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/ext-src/jobs/bar.js rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/jobs/bar.js diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/ext-src/jobs/returnHello.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/jobs/returnHello.ts similarity index 64% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/ext-src/jobs/returnHello.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/jobs/returnHello.ts index 1e909ad769..89d9ac5603 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/ext-src/jobs/returnHello.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/jobs/returnHello.ts @@ -1,4 +1,4 @@ -import { ReturnHelloJob } from '../../jobs/ReturnHelloJob' +import { ReturnHelloJob } from 'wasp/server/jobs' export const returnHello: ReturnHelloJob<{ name: string }, string> = async (args) => { return args.name } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/ext-src/myServerSetupCode.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/myServerSetupCode.js similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/ext-src/myServerSetupCode.js rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/myServerSetupCode.js diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/ext-src/queries/bar.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/queries/bar.js similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/ext-src/queries/bar.js rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/server/queries/bar.js diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/waspLogo.png b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/waspLogo.png similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/waspLogo.png rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/ext-src/waspLogo.png diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/package.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/package.json new file mode 100644 index 0000000000..0930955659 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/package.json @@ -0,0 +1,106 @@ +{ + "dependencies": { + "@lucia-auth/adapter-prisma": "^4.0.0-beta.9", + "@prisma/client": "4.16.2", + "@sendgrid/mail": "^7.7.0", + "@stitches/react": "^1.2.8", + "@tanstack/react-query": "^4.29.0", + "@testing-library/jest-dom": "^6.3.0", + "@testing-library/react": "^14.1.2", + "@types/express-serve-static-core": "^4.17.13", + "@vitest/ui": "^1.2.1", + "axios": "^1.4.0", + "express": "~4.18.1", + "jsdom": "^21.1.1", + "jsonwebtoken": "^8.5.1", + "lodash.merge": "^4.6.2", + "lucia": "^3.0.0-beta.14", + "mitt": "3.0.0", + "msw": "^1.1.0", + "pg-boss": "^8.4.2", + "prisma": "4.16.2", + "react": "^18.2.0", + "react-hook-form": "^7.45.4", + "react-router-dom": "^5.3.3", + "secure-password": "^4.0.0", + "sodium-native": "3.3.0", + "superjson": "^1.12.2", + "uuid": "^9.0.0", + "vitest": "^1.2.1" + }, + "devDependencies": { + "@tsconfig/node18": "latest" + }, + "exports": { + "./api/events": "./dist/api/events.js", + "./auth": "./dist/auth/index.js", + "./auth/helpers/user": "./dist/auth/helpers/user.js", + "./auth/jwt": "./dist/auth/jwt.js", + "./auth/pages/createAuthRequiredPage": "./dist/auth/pages/createAuthRequiredPage.jsx", + "./auth/password": "./dist/auth/password.js", + "./auth/providers/types": "./dist/auth/providers/types.js", + "./auth/session": "./dist/auth/session.js", + "./auth/utils": "./dist/auth/utils.js", + "./auth/validation": "./dist/auth/validation.js", + "./client": "./dist/client/index.js", + "./client/api": "./dist/api/index.js", + "./client/auth": "./dist/client/auth/index.js", + "./client/crud": "./dist/client/crud/index.js", + "./client/operations": "./dist/client/operations/index.js", + "./client/router": "./dist/client/router/index.js", + "./client/test": "./dist/client/test/index.js", + "./client/test/*": "./dist/client/test/*.js", + "./client/webSocket": "./dist/client/webSocket/index.js", + "./client/webSocket/WebSocketProvider": "./dist/client/webSocket/WebSocketProvider.jsx", + "./core/auth": "./dist/core/auth.js", + "./core/config": "./dist/core/config.js", + "./core/stitches.config": "./dist/core/stitches.config.js", + "./core/storage": "./dist/core/storage.js", + "./dev": "./dist/dev/index.js", + "./entities": "./dist/entities/index.js", + "./ext-src/*": "./dist/ext-src/*.js", + "./operations": "./dist/operations/index.js", + "./operations/*": "./dist/operations/*", + "./server": "./dist/server/index.js", + "./server/api": "./dist/server/api/index.js", + "./server/auth": "./dist/server/auth/index.js", + "./server/auth/email": "./dist/server/auth/email/index.js", + "./server/auth/email/utils": "./dist/server/auth/email/utils.js", + "./server/crud": "./dist/server/crud/index.js", + "./server/crud/*": "./dist/server/crud/*", + "./server/email": "./dist/server/email/index.js", + "./server/email/core/types": "./dist/server/email/core/types.js", + "./server/jobs": "./dist/server/jobs/index.js", + "./server/jobs/*": "./dist/server/jobs/*.js", + "./server/jobs/core/pgBoss": "./dist/server/jobs/core/pgBoss/index.js", + "./server/middleware": "./dist/server/middleware/index.js", + "./server/opeations/actions": "./dist/server/actions/index.js", + "./server/operations": "./dist/server/operations/index.js", + "./server/operations/queries": "./dist/server/queries/index.js", + "./server/types": "./dist/server/types/index.js", + "./server/utils": "./dist/server/utils.js", + "./server/webSocket": "./dist/server/webSocket/index.js", + "./universal/types": "./dist/universal/types.js", + "./universal/url": "./dist/universal/url.js", + "./universal/validators": "./dist/universal/validators.js" + }, + "include": [ + "src/**/*" + ], + "license": "ISC", + "name": "wasp", + "private": true, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "types": "tsc --declaration --emitDeclarationOnly --stripInternal --declarationDir dist" + }, + "type": "module", + "typesVersions": { + "*": { + "client/api": [ + "api/index.ts" + ] + } + }, + "version": "1.0.0" +} diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/core/HttpError.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/HttpError.ts similarity index 67% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/core/HttpError.js rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/HttpError.ts index 8a2cb04db5..3e8d3f5a0d 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/core/HttpError.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/HttpError.ts @@ -1,5 +1,8 @@ -class HttpError extends Error { - constructor (statusCode, message, data, ...params) { +export class HttpError extends Error { + public statusCode: number + public data: unknown + + constructor (statusCode: number, message?: string, data?: Record, ...params: unknown[]) { super(message, ...params) if (Error.captureStackTrace) { @@ -18,5 +21,3 @@ class HttpError extends Error { } } } - -export default HttpError diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/_types/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/_types/index.ts similarity index 91% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/_types/index.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/_types/index.ts index fc52fa392d..081b449dc3 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/_types/index.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/_types/index.ts @@ -1,17 +1,17 @@ -import { type Expand } from "../universal/types.js"; +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 "../dbClient.js" +import { prisma } from 'wasp/server' import { type User, type Auth, type AuthIdentity, -} from "../entities" +} from "wasp/entities" import { type EmailProviderData, type UsernameProviderData, type OAuthProviderData, -} from '../auth/utils.js' +} from 'wasp/auth/utils' import { type _Entity } from "./taggedEntities" import { type Payload } from "./serialization"; @@ -80,7 +80,7 @@ type Context = Expand<{ entities: Expand> }> -type ContextWithUser = Expand & { user?: SanitizedUser }> +type ContextWithUser = Expand & { user?: AuthUser }> // TODO: This type must match the logic in auth/session.js (if we remove the // password field from the object there, we must do the same here). Ideally, @@ -91,10 +91,10 @@ export type DeserializedAuthIdentity = Expand providerData: Omit | Omit | OAuthProviderData }> -export type SanitizedUser = User & { +export type AuthUser = User & { auth: Auth & { identities: DeserializedAuthIdentity[] } | null } -export type { ProviderName } from '../auth/utils.js' +export type { ProviderName } from 'wasp/auth/utils' diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/_types/serialization.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/_types/serialization.ts similarity index 95% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/_types/serialization.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/_types/serialization.ts index 595b5ba69f..c8ff9c1ae3 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/_types/serialization.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/_types/serialization.ts @@ -18,7 +18,7 @@ export interface JSONObject { type PrimitiveJSONValue = string | number | boolean | undefined | null -interface JSONArray extends Array {} +export interface JSONArray extends Array {} type SerializableJSONValue = | Symbol diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/_types/taggedEntities.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts similarity index 96% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/_types/taggedEntities.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts index 4469a7f4c5..d1d69e6af8 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/_types/taggedEntities.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts @@ -9,7 +9,7 @@ import { type User, type SocialLogin, type Task, -} from '../entities' +} from 'wasp/entities' export type _User = WithName export type _SocialLogin = WithName diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/apis/types.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/api/index.ts similarity index 86% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/apis/types.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/api/index.ts index 513bbc59e7..3071f12f28 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/apis/types.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/api/index.ts @@ -1,20 +1,20 @@ import { type ParamsDictionary as ExpressParams, type Query as ExpressQuery } from 'express-serve-static-core' -export type { ParamsDictionary as ExpressParams, Query as ExpressQuery } from 'express-serve-static-core' - import { type Api, type AuthenticatedApi, } from '../_types' + +// PUBLIC API export type FooBar< P extends ExpressParams = ExpressParams, ResBody = any, ReqBody = any, ReqQuery extends ExpressQuery = ExpressQuery, Locals extends Record = Record -> = +> = AuthenticatedApi< [ ], @@ -24,14 +24,13 @@ export type FooBar< ReqQuery, Locals > - export type FooBaz< P extends ExpressParams = ExpressParams, ResBody = any, ReqBody = any, ReqQuery extends ExpressQuery = ExpressQuery, Locals extends Record = Record -> = +> = Api< [ ], @@ -41,4 +40,3 @@ export type FooBaz< ReqQuery, Locals > - diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/index.ts new file mode 100644 index 0000000000..181ba4fcf6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/index.ts @@ -0,0 +1,25 @@ +export { + defineUserSignupFields, +} from '../../auth/providers/types.js' + +export { + createProviderId, + sanitizeAndSerializeProviderData, + updateAuthIdentityProviderData, + deserializeAndSanitizeProviderData, + findAuthIdentity, + createUser, + type ProviderId, + type ProviderName, + type EmailProviderData, + type UsernameProviderData, + type OAuthProviderData, +} from '../../auth/utils.js' + +export { + ensurePasswordIsPresent, + ensureValidPassword, + ensureTokenIsPresent, +} from '../../auth/validation.js' + + diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/config.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/config.ts similarity index 61% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/config.js rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/config.ts index 8c128dc1fd..5c22ee596d 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/config.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/config.ts @@ -1,6 +1,6 @@ import merge from 'lodash.merge' -import { stripTrailingSlash } from "./universal/url.js"; +import { stripTrailingSlash } from "wasp/universal/url"; const env = process.env.NODE_ENV || 'development' @@ -9,13 +9,36 @@ const env = process.env.NODE_ENV || 'development' // - Use convict library to define schema and validate env vars. // https://codingsans.com/blog/node-config-best-practices -const config = { +type BaseConfig = { + allowedCORSOrigins: string | string[]; + auth: { + jwtSecret: string | undefined; + } +} + +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, - frontendUrl: undefined, allowedCORSOrigins: [], auth: { jwtSecret: undefined @@ -25,10 +48,11 @@ const config = { production: getProductionConfig(), } -const resolvedConfig = merge(config.all, config[env]) +const resolvedConfig: Config = merge(config.all, config[env]) +// PUBLIC API export default resolvedConfig -function getDevelopmentConfig() { +function getDevelopmentConfig(): EnvConfig { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); return { frontendUrl, @@ -39,7 +63,7 @@ function getDevelopmentConfig() { } } -function getProductionConfig() { +function getProductionConfig(): EnvConfig { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); return { frontendUrl, diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/crud/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/crud/index.ts new file mode 100644 index 0000000000..aec6d86189 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/crud/index.ts @@ -0,0 +1,2 @@ + + export type { tasks } from './tasks'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/crud/tasks.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/crud/tasks.ts new file mode 100644 index 0000000000..03c2534280 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/crud/tasks.ts @@ -0,0 +1,46 @@ +import type { + AuthenticatedAction, + AuthenticatedQuery, + _Task, +} from "wasp/server/_types"; +import type { Prisma } from "@prisma/client"; +import { Payload } from "wasp/server/_types/serialization"; +import type { + Task, +} from "wasp/entities"; + +type _WaspEntityTagged = _Task +type _WaspEntity = Task + +/** + * PUBLIC API + */ +export namespace tasks { + export type GetAllQuery = AuthenticatedQuery<[_WaspEntityTagged], Input, Output> + + export type GetQuery = AuthenticatedQuery<[_WaspEntityTagged], Input, Output> + + export type CreateAction= AuthenticatedAction<[_WaspEntityTagged], Input, Output> + + +} + +/** + * PRIVATE API + * + * The types with the `Resolved` suffix are the types that are used internally by the Wasp client + * to implement full-stack type safety. + */ +type GetAllInput = {} +type GetAllOutput = _WaspEntity[] +export type GetAllQueryResolved = tasks.GetAllQuery + +type GetInput = Prisma.TaskWhereUniqueInput +type GetOutput = _WaspEntity | null +export type GetQueryResolved = tasks.GetQuery + +type CreateInput = Prisma.TaskCreateInput +type CreateOutput = _WaspEntity +export type CreateActionResolved = tasks.CreateAction + + diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/dbClient.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/dbClient.ts new file mode 100644 index 0000000000..29400dd127 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/dbClient.ts @@ -0,0 +1,10 @@ +import Prisma from '@prisma/client' + +function createDbClient(): Prisma.PrismaClient { + return new Prisma.PrismaClient() +} + +const dbClient = createDbClient() + +// PUBLIC API +export default dbClient diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/email/core/helpers.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/core/helpers.ts similarity index 94% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/email/core/helpers.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/core/helpers.ts index 3a0cdcd457..48ab9c366d 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/email/core/helpers.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/core/helpers.ts @@ -1,5 +1,6 @@ import { EmailFromField } from "./types"; +// PRIVATE API // Formats an email address and an optional name into a string that can be used // as the "from" field in an email. // { email: "test@test.com, name: "Test" } -> "Test " @@ -16,6 +17,7 @@ export function formatFromField({ return email; } +// PRIVATE API export function getDefaultFromField(): EmailFromField { return { email: "hello@itsme.com", diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/core/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/core/index.ts new file mode 100644 index 0000000000..f1365d1b3f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/core/index.ts @@ -0,0 +1,2 @@ +// PRIVATE API +export { initSendGridEmailSender as initEmailSender } from "./providers/sendgrid.js"; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/email/core/providers/sendgrid.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/core/providers/sendgrid.ts similarity index 88% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/email/core/providers/sendgrid.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/core/providers/sendgrid.ts index 3ce8d39cd4..e5a4ffc4eb 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/email/core/providers/sendgrid.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/core/providers/sendgrid.ts @@ -1,7 +1,8 @@ import SendGrid from "@sendgrid/mail"; import { getDefaultFromField } from "../helpers.js"; -import type { SendGridProvider, EmailSender } from "../types.js"; +import type { SendGridProvider, EmailSender } from "../types"; +// PRIVATE API export function initSendGridEmailSender( provider: SendGridProvider ): EmailSender { diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/email/core/types.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/core/types.ts similarity index 85% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/email/core/types.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/core/types.ts index f5274ac498..a4418dd413 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/email/core/types.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/core/types.ts @@ -1,5 +1,7 @@ +// PRIVATE API export type EmailProvider = SMTPEmailProvider | SendGridProvider | MailgunEmailProvider | DummyEmailProvider; +// PRIVATE API export type SMTPEmailProvider = { type: "smtp"; host: string; @@ -8,27 +10,33 @@ export type SMTPEmailProvider = { password: string; }; +// PRIVATE API export type SendGridProvider = { type: "sendgrid"; apiKey: string; }; +// PRIVATE API export type MailgunEmailProvider = { type: "mailgun"; apiKey: string; domain: string; }; +// PRIVATE API export type DummyEmailProvider = { type: "dummy"; } +// PRIVATE API export type EmailSender = { send: (email: Email) => Promise; }; +// PRIVATE API export type SentMessageInfo = any; +// PUBLIC API export type Email = { from?: EmailFromField; to: string; @@ -37,6 +45,7 @@ export type Email = { html: string; }; +// PUBLIC API export type EmailFromField = { name?: string; email: string; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/email/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/index.ts similarity index 69% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/email/index.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/index.ts index 4deb2c8c68..28b7839f62 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/email/index.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/index.ts @@ -5,4 +5,8 @@ const emailProvider = { apiKey: process.env.SENDGRID_API_KEY, } as const; +// PUBLIC API export const emailSender = initEmailSender(emailProvider); + +// PUBLIC API +export type { Email, EmailFromField } from "./core/types.js"; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/index.ts new file mode 100644 index 0000000000..535077900b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/core/job.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/job.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/core/job.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/job.ts diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/index.ts new file mode 100644 index 0000000000..b6789d10c6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/index.ts @@ -0,0 +1,3 @@ +export { type JobFn } from './types' +export { registerJob, createJobDefinition } from './pgBossJob.js' +export { startPgBoss } from './pgBoss.js' diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/core/pgBoss/pgBoss.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts similarity index 96% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/core/pgBoss/pgBoss.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts index e7600991ed..a48992aad0 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/core/pgBoss/pgBoss.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts @@ -1,5 +1,5 @@ import PgBoss from 'pg-boss' -import config from '../../../config.js' +import { config } from 'wasp/server' const boss = createPgBoss() @@ -24,6 +24,7 @@ function createPgBoss() { let resolvePgBossStarted: (boss: PgBoss) => void let rejectPgBossStarted: (boss: PgBoss) => void +// PRIVATE API // Code that wants to access pg-boss must wait until it has been started. export const pgBossStarted = new Promise((resolve, reject) => { resolvePgBossStarted = resolve @@ -39,6 +40,7 @@ enum PgBossStatus { let pgBossStatus: PgBossStatus = PgBossStatus.Unstarted +// PRIVATE API /** * Prepares the target PostgreSQL database and begins job monitoring. * If the required database objects do not exist in the specified database, diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/core/pgBoss/pgBossJob.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts similarity index 76% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/core/pgBoss/pgBossJob.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts index 5e50f97e73..42435db213 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/core/pgBoss/pgBossJob.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts @@ -1,41 +1,63 @@ import PgBoss from 'pg-boss' import { pgBossStarted } from './pgBoss.js' import { Job, SubmittedJob } from '../job.js' -import type { JSONValue, JSONObject } from '../../../_types/serialization.js' -import { PrismaDelegate } from '../../../_types/index.js' +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization' +import { PrismaDelegate } from 'wasp/server/_types' +import type { JobFn } from 'wasp/server/jobs/core/pgBoss' export const PG_BOSS_EXECUTOR_NAME = Symbol('PgBoss') +type JobSchedule = { + cron: Parameters[1] + args: Parameters[2] + options: Parameters[3] +} + +// PRIVATE API /** - * Creates an instance of PgBossJob and initializes the PgBoss executor by registering this job function. - * We expect this to be called once per job name. If called multiple times with the same name and different - * functions, we will override the previous calls. + * Creates an instance of PgBossJob which contains all of the necessary + * information to submit a job to pg-boss. */ -export function createJob< +export function createJobDefinition< Input extends JSONObject, Output extends JSONValue | void, Entities extends Partial >({ jobName, - jobFn, defaultJobOptions, jobSchedule, entities, }: { // jobName - The user-defined job name in their .wasp file. jobName: Parameters[0] - // jobFn - The user-defined async job callback function. - jobFn: JobFn // defaultJobOptions - pg-boss specific options for `boss.send()` applied to every `submit()` invocation, // which can overriden in that call. defaultJobOptions: PgBoss.Schedule['options'] - jobSchedule?: { - cron: Parameters[1] - args: Parameters[2] - options: Parameters[3] - } + jobSchedule: JobSchedule | null // Entities used by job, passed into callback context. entities: Entities +}) { + return new PgBossJob( + jobName, + defaultJobOptions, + entities, + jobSchedule, + ) +} + +// PRIVATE API +/** + * Uses the info about a job in PgBossJob to register a user defined job handler with pg-boss. + * We expect this to be called once per job name. If called multiple times with the same name and different + * functions, we will override the previous calls. + */ +export function registerJob< + Input extends JSONObject, + Output extends JSONValue | void, + Entities extends Partial +>({ job, jobFn }: { + job: PgBossJob, + jobFn: JobFn, }) { // NOTE(shayne): We are not awaiting `pgBossStarted` here since we need to return an instance to the job // template, or else the NodeJS module bootstrapping process will block and fail as it would then depend @@ -48,41 +70,33 @@ export function createJob< pgBossStarted.then(async (boss) => { // As a safety precaution against undefined behavior of registering different // functions for the same job name, remove all registered functions first. - await boss.offWork(jobName) + await boss.offWork(job.jobName) // This tells pg-boss to run given worker function when job with that name is submitted. // Ref: https://github.com/timgit/pg-boss/blob/master/docs/readme.md#work await boss.work( - jobName, - pgBossCallbackWrapper(jobFn, entities) + job.jobName, + pgBossCallbackWrapper(jobFn, job.entities) ) // If a job schedule is provided, we should schedule the recurring job. // If the schedule name already exists, it's updated to the provided cron expression, arguments, and options. // Ref: https://github.com/timgit/pg-boss/blob/master/docs/readme.md#scheduling - if (jobSchedule) { + if (job.jobSchedule) { const options: PgBoss.ScheduleOptions = { - ...defaultJobOptions, - ...jobSchedule.options, + ...job.defaultJobOptions, + ...job.jobSchedule.options, } await boss.schedule( - jobName, - jobSchedule.cron, - jobSchedule.args || null, + job.jobName, + job.jobSchedule.cron, + job.jobSchedule.args || null, options ) } }) - - return new PgBossJob(jobName, defaultJobOptions) } -export type JobFn< - Input extends JSONObject, - Output extends JSONValue | void, - Entities extends Partial -> = (data: Input, context: { entities: Entities }) => Promise - /** * This is an interface repesenting a job that can be submitted to pg-boss. * It is not yet submitted until the caller invokes `submit()` on an instance. @@ -90,24 +104,33 @@ export type JobFn< */ class PgBossJob< Input extends JSONObject, - Output extends JSONValue | void + Output extends JSONValue | void, + Entities extends Partial > extends Job { public readonly defaultJobOptions: Parameters[2] public readonly startAfter: number | string | Date + public readonly entities: Entities + public readonly jobSchedule: JobSchedule | null constructor( jobName: string, defaultJobOptions: Parameters[2], + entities: Entities, + jobSchedule: JobSchedule | null, startAfter?: number | string | Date ) { super(jobName, PG_BOSS_EXECUTOR_NAME) this.defaultJobOptions = defaultJobOptions + this.entities = entities + this.jobSchedule = jobSchedule this.startAfter = startAfter } delay(startAfter: number | string | Date) { - return new PgBossJob( + return new PgBossJob( this.jobName, this.defaultJobOptions, + this.entities, + this.jobSchedule, startAfter ) } @@ -118,7 +141,7 @@ class PgBossJob< ...(this.startAfter && { startAfter: this.startAfter }), ...jobOptions, }) - return new PgBossSubmittedJob(boss, this, jobId) + return new PgBossSubmittedJob(boss, this, jobId) } } @@ -127,7 +150,8 @@ class PgBossJob< */ class PgBossSubmittedJob< Input extends JSONObject, - Output extends JSONValue | void + Output extends JSONValue | void, + Entities extends Partial > extends SubmittedJob { public readonly pgBoss: { readonly cancel: () => ReturnType @@ -137,7 +161,7 @@ class PgBossSubmittedJob< constructor( boss: PgBoss, - job: PgBossJob, + job: PgBossJob, jobId: SubmittedJob['jobId'] ) { super(job, jobId) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/types.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/types.ts new file mode 100644 index 0000000000..4ebb34b61b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/types.ts @@ -0,0 +1,9 @@ +import { PrismaDelegate } from 'wasp/server/_types' +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization' + +// PRIVATE API +export type JobFn< + Input extends JSONObject, + Output extends JSONValue | void, + Entities extends Partial +> = (data: Input, context: { entities: Entities }) => Promise diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/index.ts new file mode 100644 index 0000000000..a7cddb90db --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/index.ts @@ -0,0 +1,3 @@ + +export { type MySpecialJob, mySpecialJob } from './mySpecialJob.js' +export { type ReturnHelloJob, returnHelloJob } from './returnHelloJob.js' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts new file mode 100644 index 0000000000..574030dba0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts @@ -0,0 +1,17 @@ +import { prisma } from 'wasp/server' +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization' +import { type JobFn, createJobDefinition } from 'wasp/server/jobs/core/pgBoss' + +const entities = { +} + +// PUBLIC API +export type MySpecialJob = JobFn + +// PUBLIC API +export const mySpecialJob = createJobDefinition({ + jobName: 'mySpecialJob', + defaultJobOptions: {}, + jobSchedule: null, + entities, +}) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/returnHelloJob.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/returnHelloJob.ts new file mode 100644 index 0000000000..c30d179a16 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/returnHelloJob.ts @@ -0,0 +1,18 @@ +import { prisma } from 'wasp/server' +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization' +import { type JobFn, createJobDefinition } from 'wasp/server/jobs/core/pgBoss' + +const entities = { + User: prisma.user, +} + +// PUBLIC API +export type ReturnHelloJob = JobFn + +// PUBLIC API +export const returnHelloJob = createJobDefinition({ + jobName: 'returnHelloJob', + defaultJobOptions: {}, + jobSchedule: null, + entities, +}) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts new file mode 100644 index 0000000000..8bab5e4709 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/middleware/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/middleware/index.ts new file mode 100644 index 0000000000..50996ec27d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/middleware/index.ts @@ -0,0 +1 @@ +export * from './globalMiddleware.js' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/actions/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/actions/index.ts new file mode 100644 index 0000000000..d16381ceff --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/actions/index.ts @@ -0,0 +1,16 @@ +import { prisma } from 'wasp/server' + +import { foo as foo_ext } from 'wasp/ext-src/server/actions/bar.js' + +// PRIVATE API +export type MySpecialAction = typeof foo_ext + +// PUBLIC API +export const mySpecialAction = async (args, context) => { + return (foo_ext as any)(args, { + ...context, + entities: { + User: prisma.user, + }, + }) +} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/actions/types.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/actions/types.ts new file mode 100644 index 0000000000..34626e16ff --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/actions/types.ts @@ -0,0 +1,16 @@ +import { + type _User, + type AuthenticatedAction, + type Payload, +} from 'wasp/server/_types' + +// PUBLIC API +export type MySpecialAction = + AuthenticatedAction< + [ + _User, + ], + Input, + Output + > + diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/index.ts new file mode 100644 index 0000000000..1460b3e7f3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/index.ts @@ -0,0 +1,8 @@ +// PUBLIC API +export * from './queries/types.js' +// PUBLIC API +export * from './actions/types.js' + +export { mySpecialQuery } from './queries/index.js' + +export { mySpecialAction } from './actions/index.js' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/queries/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/queries/index.ts new file mode 100644 index 0000000000..89e8ceb431 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/queries/index.ts @@ -0,0 +1,16 @@ +import { prisma } from 'wasp/server' + +import { foo as foo_ext } from 'wasp/ext-src/server/queries/bar.js' + +// PRIVATE API +export type MySpecialQuery = typeof foo_ext + +// PUBLIC API +export const mySpecialQuery = async (args, context) => { + return (foo_ext as any)(args, { + ...context, + entities: { + User: prisma.user, + }, + }) +} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/queries/types.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/queries/types.ts new file mode 100644 index 0000000000..f0fb44a4ee --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/operations/queries/types.ts @@ -0,0 +1,17 @@ + +import { + type _User, + type AuthenticatedQuery, + type Payload, +} from 'wasp/server/_types' + +// PUBLIC API +export type MySpecialQuery = + AuthenticatedQuery< + [ + _User, + ], + Input, + Output + > + diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/types/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/types/index.ts similarity index 73% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/types/index.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/types/index.ts index b30c92f5ec..1bbffc7555 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/types/index.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/types/index.ts @@ -1,14 +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, } - -export type { Application } from 'express' -export type { Server } from 'http' - diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/utils.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/utils.ts similarity index 52% rename from waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/utils.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/utils.ts index 99492c5474..a7c640cbff 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/utils.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/utils.ts @@ -5,8 +5,11 @@ import { readdir } from 'fs' import { dirname } from 'path' import { fileURLToPath } from 'url' +import { type AuthUser } from 'wasp/auth' type RequestWithExtraFields = Request & { + user?: AuthUser; + sessionId?: string; } /** @@ -32,33 +35,3 @@ async (req: RequestWithExtraFields, res: Response, next: NextFunction) => { } export const sleep = (ms: number): Promise => new Promise((r) => setTimeout(r, ms)) - -export function getDirPathFromFileUrl(fileUrl: string): string { - return fileURLToPath(dirname(fileUrl)) -} - -export async function importJsFilesFromDir( - pathToDir: string, - whitelistedFileNames: string[] | null = null -): Promise { - return new Promise((resolve, reject) => { - readdir(pathToDir, async (err, files) => { - if (err) { - return reject(err) - } - const importPromises = files - .filter((file) => file.endsWith('.js') && isWhitelistedFileName(file)) - .map((file) => import(`${pathToDir}/${file}`)) - resolve(Promise.all(importPromises)) - }) - }) - - function isWhitelistedFileName(fileName: string) { - // No whitelist means all files are whitelisted - if (!Array.isArray(whitelistedFileNames)) { - return true - } - - return whitelistedFileNames.some((whitelistedFileName) => fileName === whitelistedFileName) - } -} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/tsconfig.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/tsconfig.json new file mode 100644 index 0000000000..a7030c61d5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/server/src/universal/types.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/types.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/universal/types.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/types.ts diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/universal/url.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/url.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/universal/url.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/url.ts diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/validators.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/validators.ts new file mode 100644 index 0000000000..3d30d9622a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/nodemon.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/nodemon.json index 9ac8c1df77..01fe71701a 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/nodemon.json +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/nodemon.json @@ -4,7 +4,9 @@ }, "watch": [ "src/", + "../../../src/", ".env" ], + "comment-filip": "We now have to watch ../../../src/ because we're importing client files directly", "ext": "ts,mts,js,mjs,json" } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/package.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/package.json index d17c69c2d5..ebdda4b822 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/package.json +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/package.json @@ -1,27 +1,18 @@ { + "comment-filip": "The server.js location changed because we have now included client source files above .wasp/out/server/src.", "dependencies": { - "@lucia-auth/adapter-prisma": "^4.0.0-beta.9", - "@prisma/client": "4.16.2", - "@sendgrid/mail": "^7.7.0", "cookie-parser": "~1.4.6", "cors": "^2.8.5", "dotenv": "16.0.2", "express": "~4.18.1", "helmet": "^6.0.0", "jsonwebtoken": "^8.5.1", - "lodash.merge": "^4.6.2", - "lucia": "^3.0.0-beta.14", "morgan": "~1.10.0", "passport": "0.6.0", "passport-google-oauth20": "2.0.0", - "patch-package": "^6.4.7", - "pg-boss": "^8.4.2", "rate-limiter-flexible": "^2.4.1", - "react-redux": "^7.1.3", - "redux": "^4.0.5", "secure-password": "^4.0.0", - "superjson": "^1.12.2", - "uuid": "^9.0.0" + "superjson": "^1.12.2" }, "devDependencies": { "@tsconfig/node18": "latest", @@ -29,38 +20,32 @@ "@types/express": "^4.17.13", "@types/express-serve-static-core": "^4.17.13", "@types/node": "^18.0.0", - "@types/uuid": "^9.0.0", "nodemon": "^2.0.19", - "prisma": "4.16.2", - "standard": "^17.0.0", - "typescript": "^5.1.0" + "rollup": "^4.9.6", + "rollup-plugin-esbuild": "^6.1.1", + "standard": "^17.0.0" }, "engineStrict": true, "engines": { - "node": ">=18.0.0" + "node": ">=18.18.0" }, "name": "server", "nodemonConfig": { "delay": "1000" }, - "overrides": { - "secure-password": { - "sodium-native": "3.3.0" - } - }, + "overrides": {}, "prisma": {}, "private": true, "scripts": { - "build": "npx tsc", - "build-and-start": "npm run build && npm run start", + "bundle": "rollup --config --silent", + "bundle-and-start": "npm run bundle && npm run start", "db-migrate-prod": "prisma migrate deploy --schema=../db/schema.prisma", - "db-seed": "npm run build && NODE_PATH=dist node -r dotenv/config dist/dbSeed.js", - "postinstall": "patch-package", + "db-seed": "npm run bundle && node --enable-source-maps -r dotenv/config bundle/dbSeed.js", "standard": "standard", - "start": "npm run validate-env && NODE_PATH=dist node -r dotenv/config dist/server.js", + "start": "npm run validate-env && node --enable-source-maps -r dotenv/config bundle/server.js", "start-production": "npm run db-migrate-prod && NODE_ENV=production npm run start", "validate-env": "node -r dotenv/config ./scripts/validate-env.mjs", - "watch": "nodemon --exec 'npm run build-and-start || exit 1'" + "watch": "nodemon --exec 'npm run bundle-and-start || exit 1'" }, "type": "module", "version": "0.0.0" diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/patches/oauth+0.9.15.patch b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/patches/oauth+0.9.15.patch deleted file mode 100644 index a797ef0353..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/patches/oauth+0.9.15.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/node_modules/oauth/lib/oauth2.js b/node_modules/oauth/lib/oauth2.js -index 77241c4..b6c0184 100644 ---- a/node_modules/oauth/lib/oauth2.js -+++ b/node_modules/oauth/lib/oauth2.js -@@ -158,8 +158,14 @@ exports.OAuth2.prototype._executeRequest= function( http_library, options, post_ - }); - }); - request.on('error', function(e) { -- callbackCalled= true; -- callback(e); -+ // Ref: https://github.com/ciaranj/node-oauth/pull/363 -+ // `www.googleapis.com` does `ECONNRESET` just after data is received in `passBackControl` -+ // this prevents the callback from being called twice, first in passBackControl and second time in here -+ // see also NodeJS Stream documentation: "The 'error' event may be emitted by a Readable implementation at any time" -+ if(!callbackCalled) { -+ callbackCalled= true; -+ callback(e); -+ } - }); - - if( (options.method == 'POST' || options.method == 'PUT') && post_body ) { diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/rollup.config.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/rollup.config.js new file mode 100644 index 0000000000..9f0b986fb9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/rollup.config.js @@ -0,0 +1,24 @@ +import esbuild from 'rollup-plugin-esbuild' + +export default [ + createBundle('src/server.ts', 'bundle/server.js'), +] + +function createBundle(inputFilePath, outputFilePath) { + return { + input: inputFilePath, + output: { + file: outputFilePath, + format: 'es', + sourcemap: true, + }, + plugins: [ + esbuild({ + target: 'esnext', + }), + ], + // We don't want to bundle any of the node_module deps + // as we want to keep them as external dependencies + external: (id) => !/^[./]/.test(id), + } +} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/scripts/universal/validators.mjs b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/scripts/universal/validators.mjs deleted file mode 100644 index 9e3605d3b5..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/scripts/universal/validators.mjs +++ /dev/null @@ -1,21 +0,0 @@ -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`); - } -} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/scripts/validate-env.mjs index fb68580bbb..ac264b7961 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/scripts/validate-env.mjs +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/scripts/validate-env.mjs @@ -1,4 +1,4 @@ -import { throwIfNotValidAbsoluteURL } from './universal/validators.mjs'; +import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; console.info("🔍 Validating environment variables..."); throwIfNotValidAbsoluteURL(process.env.WASP_WEB_CLIENT_URL, 'Environment variable WASP_WEB_CLIENT_URL'); diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/actions/MySpecialAction.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/actions/mySpecialAction.ts similarity index 66% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/actions/MySpecialAction.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/actions/mySpecialAction.ts index 32b9410014..acef451753 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/actions/MySpecialAction.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/actions/mySpecialAction.ts @@ -1,6 +1,6 @@ -import prisma from '../dbClient.js' +import { prisma } from 'wasp/server' -import { foo } from '../ext-src/actions/bar.js' +import { foo } from '../../../../../src/server/actions/bar.js' export default async function (args, context) { diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/actions/types.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/actions/types.ts index 5038b29253..b5eeee2b65 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/actions/types.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/actions/types.ts @@ -2,7 +2,7 @@ import { type _User, type AuthenticatedAction, type Payload, -} from '../_types' +} from 'wasp/server/_types' export type MySpecialAction = AuthenticatedAction< diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/app.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/app.js index a15cb96cea..025a3c4c14 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/app.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/app.js @@ -1,6 +1,6 @@ import express from 'express' -import HttpError from './core/HttpError.js' +import { HttpError } from 'wasp/server' import indexRouter from './routes/index.js' // TODO: Consider extracting most of this logic into createApp(routes, path) function so that diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/config/google.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/config/google.ts index bb1c95b470..2d78f640b9 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/config/google.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/config/google.ts @@ -2,7 +2,7 @@ import { createRouter } from "../oauth/createRouter.js"; import { makeOAuthInit } from "../oauth/init.js"; -import type { ProviderConfig } from "../types.js"; +import type { ProviderConfig } from "wasp/auth/providers/types"; import type { OAuthConfig } from "../oauth/types.js"; const _waspUserSignupFields = undefined diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/index.ts index c96736abe3..bacf3cb737 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/index.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/index.ts @@ -1,15 +1,10 @@ - -import { join } from 'path' import { Router } from "express"; -import { getDirPathFromFileUrl, importJsFilesFromDir } from "../../utils.js"; - -import { ProviderConfig } from "./types"; +import google from './config/google.js' -const whitelistedProviderConfigFileNames = [ - "google.js", +const providers = [ + google, ]; -const providers = await importProviders(whitelistedProviderConfigFileNames); const router = Router(); @@ -24,10 +19,3 @@ for (const provider of providers) { } export default router; - -async function importProviders(whitelistedProviderConfigFileNames: string[]): Promise { - const currentExecutionDir = getDirPathFromFileUrl(import.meta.url); - const pathToDirWithConfigs = join(currentExecutionDir, "./config"); - const providers = await importJsFilesFromDir(pathToDirWithConfigs, whitelistedProviderConfigFileNames); - return providers.map((provider) => provider.default); -} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/createRouter.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/createRouter.ts index 3b34263c34..9f9557be39 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/createRouter.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/createRouter.ts @@ -2,8 +2,7 @@ import { Router } from "express" import passport from "passport" -import prisma from '../../../dbClient.js' -import waspServerConfig from '../../../config.js' +import { prisma, config as waspServerConfig } from 'wasp/server' import { type ProviderName, type ProviderId, @@ -14,11 +13,11 @@ import { rethrowPossibleAuthError, sanitizeAndSerializeProviderData, validateAndGetUserFields, -} from "../../utils.js" -import { createSession } from "../../session.js" -import { type Auth } from "../../../entities/index.js" -import type { ProviderConfig, RequestWithWasp, UserSignupFields } from "../types.js" -import { handleRejection } from "../../../utils.js" +} from 'wasp/auth/utils' +import { createSession } from "wasp/auth/session" +import { type Auth } from "wasp/entities" +import type { ProviderConfig, RequestWithWasp, UserSignupFields } from "wasp/auth/providers/types" +import { handleRejection } from "wasp/server/utils" // For oauth providers, we have an endpoint /login to get the auth URL, // and the /callback endpoint which is used to get the actual access_token and the user info. diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/init.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/init.ts index 1462f3a2f7..15cb5631fc 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/init.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/init.ts @@ -1,8 +1,8 @@ import passport from "passport"; -import waspServerConfig from '../../../config.js'; +import { config as waspServerConfig } from 'wasp/server'; -import type { InitData, ProviderConfig, RequestWithWasp, UserSignupFields } from "../types.js"; +import type { InitData, ProviderConfig, RequestWithWasp, UserSignupFields } from "wasp/auth/providers/types"; import type { OAuthConfig, UserDefinedConfigFn } from "./types.js"; export function makeOAuthInit({ userDefinedConfigFn, userSignupFields, npmPackage, oAuthConfig }: OAuthImports) { diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/types.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/types.ts index 3b673a4858..7107a0d544 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/types.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/types.ts @@ -1,6 +1,6 @@ import type { Prisma } from "@prisma/client" -import { contextWithUserEntity } from '../../utils.js' +import { contextWithUserEntity } from 'wasp/auth/utils' export type OAuthConfig = { clientID?: string; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/user.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/user.ts deleted file mode 100644 index 410e92058b..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/user.ts +++ /dev/null @@ -1,27 +0,0 @@ -// We decided not to deduplicate these helper functions in the server and the client. -// We have them duplicated in this file and in data/Generator/templates/react-app/src/auth/user.ts -// If you are changing the logic here, make sure to change it there as well. - -import type { SanitizedUser as User, ProviderName, DeserializedAuthIdentity } from '../_types/index' - -export function getEmail(user: User): string | null { - return findUserIdentity(user, "email")?.providerUserId ?? null; -} - -export function getUsername(user: User): string | null { - return findUserIdentity(user, "username")?.providerUserId ?? null; -} - -export function getFirstProviderUserId(user?: User): string | null { - if (!user || !user.auth || !user.auth.identities || user.auth.identities.length === 0) { - return null; - } - - return user.auth.identities[0].providerUserId ?? null; -} - -export function findUserIdentity(user: User, providerName: ProviderName): DeserializedAuthIdentity | undefined { - return user.auth.identities.find( - (identity) => identity.providerName === providerName - ); -} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/core/AuthError.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/core/AuthError.js deleted file mode 100644 index 2d965c168e..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/core/AuthError.js +++ /dev/null @@ -1,17 +0,0 @@ -class AuthError extends Error { - constructor (message, data, ...params) { - super(message, ...params) - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, AuthError) - } - - this.name = this.constructor.name - - if (data) { - this.data = data - } - } -} - -export default AuthError diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/crud/tasks.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/crud/tasks.ts index f862fe505b..3279fda953 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/crud/tasks.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/crud/tasks.ts @@ -1,34 +1,25 @@ -import prisma from "../dbClient.js"; +import { prisma } from 'wasp/server'; -import type { - AuthenticatedAction, - AuthenticatedQuery, - _Task, -} from "../_types"; import type { Prisma } from "@prisma/client"; -import { Payload } from "../_types/serialization.js"; import type { Task, -} from "../entities"; -import { throwInvalidCredentialsError } from '../auth/utils.js' +} from "wasp/entities"; +import { throwInvalidCredentialsError } from 'wasp/auth/utils' +import type { tasks } from "wasp/server/crud"; -type _WaspEntityTagged = _Task type _WaspEntity = Task const entities = { Task: prisma.task, } // Get All query -export type GetAllQuery = AuthenticatedQuery<[_WaspEntityTagged], Input, Output> type GetAllInput = {} type GetAllOutput = _WaspEntity[] -const _waspGetAllQuery: GetAllQuery = ((args, context) => { +const _waspGetAllQuery: tasks.GetAllQuery = ((args, context) => { throwIfNotAuthenticated(context) return context.entities.Task.findMany(); }); -export type GetAllQueryResolved = typeof _waspGetAllQuery - export async function getAllFn(args, context) { return (_waspGetAllQuery as any)(args, { ...context, @@ -37,14 +28,12 @@ export async function getAllFn(args, context) { } // Get query -export type GetQuery = AuthenticatedQuery<[_WaspEntityTagged], Input, Output> type GetInput = Prisma.TaskWhereUniqueInput type GetOutput = _WaspEntity | null -const _waspGetQuery: GetQuery = ((args, context) => { +const _waspGetQuery: tasks.GetQuery = ((args, context) => { throwIfNotAuthenticated(context) return context.entities.Task.findUnique({ where: { id: args.id } }); }); -export type GetQueryResolved = typeof _waspGetQuery export async function getFn(args, context) { return (_waspGetQuery as any)(args, { @@ -54,16 +43,13 @@ export async function getFn(args, context) { } // Create action -export type CreateAction= AuthenticatedAction<[_WaspEntityTagged], Input, Output> type CreateInput = Prisma.TaskCreateInput type CreateOutput = _WaspEntity -const _waspCreateAction: CreateAction = ((args, context) => { +const _waspCreateAction: tasks.CreateAction = ((args, context) => { throwIfNotAuthenticated(context) return context.entities.Task.create({ data: args }); }); -export type CreateActionResolved = typeof _waspCreateAction - export async function createFn(args, context) { return (_waspCreateAction as any)(args, { ...context, @@ -77,4 +63,4 @@ function throwIfNotAuthenticated (context) { if (!context.user) { throwInvalidCredentialsError() } -} +} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/dbClient.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/dbClient.ts deleted file mode 100644 index 66e7801be3..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/dbClient.ts +++ /dev/null @@ -1,12 +0,0 @@ -import Prisma from '@prisma/client' - - -const createDbClient = () => { - const prismaClient = new Prisma.PrismaClient() - - return prismaClient -} - -const dbClient = createDbClient() - -export default dbClient diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/dbSeed/types.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/dbSeed/types.ts deleted file mode 100644 index fe0d5396a4..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/dbSeed/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { PrismaClient } from '@prisma/client' - -export type DbSeedFn = (prismaClient: PrismaClient) => Promise diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/MySpecialJob.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/MySpecialJob.ts deleted file mode 100644 index 4e65d91038..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/MySpecialJob.ts +++ /dev/null @@ -1,17 +0,0 @@ -import prisma from '../dbClient.js' -import type { JSONValue, JSONObject } from '../_types/serialization.js' -import { createJob, type JobFn } from './core/pgBoss/pgBossJob.js' -import { foo } from '../ext-src/jobs/bar.js' - -const entities = { -}; - -export type MySpecialJob = JobFn - -export const MySpecialJob = createJob({ - jobName: "MySpecialJob", - jobFn: foo, - defaultJobOptions: {}, - jobSchedule: null, - entities, -}) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/ReturnHelloJob.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/ReturnHelloJob.ts deleted file mode 100644 index be95e80bd5..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/ReturnHelloJob.ts +++ /dev/null @@ -1,18 +0,0 @@ -import prisma from '../dbClient.js' -import type { JSONValue, JSONObject } from '../_types/serialization.js' -import { createJob, type JobFn } from './core/pgBoss/pgBossJob.js' -import { returnHello } from '../ext-src/jobs/returnHello.js' - -const entities = { - User: prisma.user, -}; - -export type ReturnHelloJob = JobFn - -export const ReturnHelloJob = createJob({ - jobName: "ReturnHelloJob", - jobFn: returnHello, - defaultJobOptions: {}, - jobSchedule: null, - entities, -}) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/core/allJobs.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/core/allJobs.ts index 5462a394c7..0bfd804768 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/core/allJobs.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/core/allJobs.ts @@ -1,6 +1,6 @@ -// This module exports all jobs and is imported by the server to ensure +// This module imports all jobs and is imported by the server to ensure // any schedules that are not referenced are still loaded by NodeJS. -export { MySpecialJob } from '../MySpecialJob.js' -export { ReturnHelloJob } from '../ReturnHelloJob.js' +import '../mySpecialJob.js' +import '../returnHelloJob.js' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/mySpecialJob.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/mySpecialJob.ts new file mode 100644 index 0000000000..e6c21cd3a5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/mySpecialJob.ts @@ -0,0 +1,8 @@ +import { registerJob } from 'wasp/server/jobs/core/pgBoss' +import { foo } from '../../../../../src/server/jobs/bar.js' +import { mySpecialJob as _waspJobDefinition } from 'wasp/server/jobs' + +registerJob({ + job: _waspJobDefinition, + jobFn: foo, +}) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/returnHelloJob.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/returnHelloJob.ts new file mode 100644 index 0000000000..399d201056 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/returnHelloJob.ts @@ -0,0 +1,8 @@ +import { registerJob } from 'wasp/server/jobs/core/pgBoss' +import { returnHello } from '../../../../../src/server/jobs/returnHello.js' +import { returnHelloJob as _waspJobDefinition } from 'wasp/server/jobs' + +registerJob({ + job: _waspJobDefinition, + jobFn: returnHello, +}) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/middleware/globalMiddleware.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/middleware/globalMiddleware.ts index 2eca3e9f74..ce46c57ead 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/middleware/globalMiddleware.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/middleware/globalMiddleware.ts @@ -4,14 +4,12 @@ import logger from 'morgan' import cors from 'cors' import helmet from 'helmet' -import config from '../config.js' +import { config } from 'wasp/server' +import type { MiddlewareConfig, MiddlewareConfigFn } from 'wasp/server/middleware' +export type { MiddlewareConfig, MiddlewareConfigFn } from 'wasp/server/middleware' const _waspGlobalMiddlewareConfigFn = (mc: MiddlewareConfig) => mc -export type MiddlewareConfig = Map - -export type MiddlewareConfigFn = (middlewareConfig: MiddlewareConfig) => MiddlewareConfig - // This is the set of middleware Wasp supplies by default. // NOTE: Remember to update the docs of these change. const defaultGlobalMiddlewareConfig: MiddlewareConfig = new Map([ diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/middleware/operations.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/middleware/operations.ts index 95acad40e5..aa92c55a03 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/middleware/operations.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/middleware/operations.ts @@ -2,7 +2,7 @@ import { deserialize as superjsonDeserialize, serialize as superjsonSerialize, } from 'superjson' -import { handleRejection } from '../utils.js' +import { handleRejection } from 'wasp/server/utils' export function createOperation (handlerFn) { return handleRejection(async (req, res) => { diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/queries/MySpecialQuery.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/queries/mySpecialQuery.ts similarity index 65% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/queries/MySpecialQuery.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/queries/mySpecialQuery.ts index 28a5c5a223..f7ef9d1f3d 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/queries/MySpecialQuery.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/queries/mySpecialQuery.ts @@ -1,6 +1,6 @@ -import prisma from '../dbClient.js' +import { prisma } from 'wasp/server' -import { foo } from '../ext-src/queries/bar.js' +import { foo } from '../../../../../src/server/queries/bar.js' export default async function (args, context) { diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/queries/types.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/queries/types.ts index 3ee5b6d5c5..b8c17430d7 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/queries/types.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/queries/types.ts @@ -3,7 +3,7 @@ import { type _User, type AuthenticatedQuery, type Payload, -} from '../_types' +} from 'wasp/server/_types' export type MySpecialQuery = AuthenticatedQuery< diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/apis/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/apis/index.ts index 6051b6b1a0..f621c4828d 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/apis/index.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/apis/index.ts @@ -1,15 +1,15 @@ import express from 'express' -import prisma from '../../dbClient.js' -import { handleRejection } from '../../utils.js' +import { prisma } from 'wasp/server' +import { handleRejection } from 'wasp/server/utils' import { MiddlewareConfigFn, globalMiddlewareConfigForExpress } from '../../middleware/index.js' -import auth from '../../core/auth.js' -import { type SanitizedUser } from '../../_types' +import auth from 'wasp/core/auth' +import { type AuthUser } from 'wasp/auth' -import { fooBarNamespaceMiddlewareFn as _waspfooBarNamespacenamespaceMiddlewareConfigFn } from '../../ext-src/apiNamespaces.js' +import { fooBarNamespaceMiddlewareFn as _waspfooBarNamespacenamespaceMiddlewareConfigFn } from '../../../../../../src/server/apiNamespaces.js' -import { fooBar as _waspfooBarfn } from '../../ext-src/apis.js' -import { fooBarMiddlewareFn as _waspfooBarmiddlewareConfigFn } from '../../ext-src/apis.js' -import { fooBaz as _waspfooBazfn } from '../../ext-src/apis.js' +import { fooBar as _waspfooBarfn } from '../../../../../../src/server/apis.js' +import { fooBarMiddlewareFn as _waspfooBarmiddlewareConfigFn } from '../../../../../../src/server/apis.js' +import { fooBaz as _waspfooBazfn } from '../../../../../../src/server/apis.js' const idFn: MiddlewareConfigFn = x => x @@ -25,7 +25,7 @@ router.get( [auth, ...fooBarMiddleware], handleRejection( ( - req: Parameters[0] & { user: SanitizedUser }, + req: Parameters[0] & { user: AuthUser }, res: Parameters[1], ) => { const context = { diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/index.js index b8041270b2..e3f4856bc0 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/index.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/index.js @@ -1,6 +1,6 @@ import express from 'express' -import auth from '../../core/auth.js' +import auth from 'wasp/core/auth' import me from './me.js' import logout from './logout.js' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/logout.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/logout.ts index 10a24a7bc5..7966e56c03 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/logout.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/logout.ts @@ -1,6 +1,6 @@ -import { handleRejection } from '../../utils.js' -import { throwInvalidCredentialsError } from '../../auth/utils.js' -import { invalidateSession } from '../../auth/session.js' +import { handleRejection } from 'wasp/server/utils' +import { throwInvalidCredentialsError } from 'wasp/auth/utils' +import { invalidateSession } from 'wasp/auth/session' export default handleRejection(async (req, res) => { if (req.sessionId) { diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/me.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/me.js index e84aff221a..8c182835d1 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/me.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/me.js @@ -1,6 +1,6 @@ import { serialize as superjsonSerialize } from 'superjson' -import { handleRejection } from '../../utils.js' -import { throwInvalidCredentialsError } from '../../auth/utils.js' +import { handleRejection } from 'wasp/server/utils' +import { throwInvalidCredentialsError } from 'wasp/auth/utils' export default handleRejection(async (req, res) => { if (req.user) { diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/crud/tasks.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/crud/tasks.ts index e8d1d4b774..d9174df3f2 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/crud/tasks.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/crud/tasks.ts @@ -1,7 +1,7 @@ import express from 'express' import * as crud from '../../crud/tasks.js' import { createAction, createQuery } from '../../middleware/operations.js' -import auth from '../../core/auth.js' +import auth from 'wasp/core/auth' const _waspRouter = express.Router() diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/MySpecialAction.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/MySpecialAction.js deleted file mode 100644 index 65e154baca..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/MySpecialAction.js +++ /dev/null @@ -1,4 +0,0 @@ -import { createAction } from '../../middleware/operations.js' -import MySpecialAction from '../../actions/MySpecialAction.js' - -export default createAction(MySpecialAction) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/MySpecialQuery.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/MySpecialQuery.js deleted file mode 100644 index 25155f2370..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/MySpecialQuery.js +++ /dev/null @@ -1,4 +0,0 @@ -import { createQuery } from '../../middleware/operations.js' -import MySpecialQuery from '../../queries/MySpecialQuery.js' - -export default createQuery(MySpecialQuery) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/index.js index 07d42c4a30..5dca473636 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/index.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/index.js @@ -1,13 +1,13 @@ import express from 'express' -import auth from '../../core/auth.js' +import auth from 'wasp/core/auth' -import MySpecialAction from './MySpecialAction.js' -import MySpecialQuery from './MySpecialQuery.js' +import mySpecialAction from './mySpecialAction.js' +import mySpecialQuery from './mySpecialQuery.js' const router = express.Router() -router.post('/my-special-action', auth, MySpecialAction) -router.post('/my-special-query', auth, MySpecialQuery) +router.post('/my-special-action', auth, mySpecialAction) +router.post('/my-special-query', auth, mySpecialQuery) export default router diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/mySpecialAction.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/mySpecialAction.js new file mode 100644 index 0000000000..630056c7f0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/mySpecialAction.js @@ -0,0 +1,4 @@ +import { createAction } from '../../middleware/operations.js' +import mySpecialAction from '../../actions/mySpecialAction.js' + +export default createAction(mySpecialAction) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/mySpecialQuery.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/mySpecialQuery.js new file mode 100644 index 0000000000..690e83c55c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/operations/mySpecialQuery.js @@ -0,0 +1,4 @@ +import { createQuery } from '../../middleware/operations.js' +import mySpecialQuery from '../../queries/mySpecialQuery.js' + +export default createQuery(mySpecialQuery) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/server.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/server.ts index b34339f7c4..0ec72f8bda 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/server.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/server.ts @@ -1,12 +1,13 @@ import http from 'http' import app from './app.js' -import config from './config.js' +import { config } from 'wasp/server' -import mySetupFunction from './ext-src/myServerSetupCode.js' -import { ServerSetupFn, ServerSetupFnContext } from './types' +import mySetupFunction from '../../../../src/server/myServerSetupCode.js' +import { ServerSetupFn } from 'wasp/server' +import { ServerSetupFnContext } from 'wasp/server/types' -import { startPgBoss } from './jobs/core/pgBoss/pgBoss.js' +import { startPgBoss } from 'wasp/server/jobs/core/pgBoss' import './jobs/core/allJobs.js' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/utils.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/utils.ts deleted file mode 100644 index b0744f3129..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/utils.ts +++ /dev/null @@ -1,67 +0,0 @@ -import crypto from 'crypto' -import { Request, Response, NextFunction } from 'express' - -import { readdir } from 'fs' -import { dirname } from 'path' -import { fileURLToPath } from 'url' - -import { type SanitizedUser } from './_types/index.js' - -type RequestWithExtraFields = Request & { - user?: SanitizedUser; - sessionId?: string; -} - -/** - * 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)) - -export function getDirPathFromFileUrl(fileUrl: string): string { - return fileURLToPath(dirname(fileUrl)) -} - -export async function importJsFilesFromDir( - pathToDir: string, - whitelistedFileNames: string[] | null = null -): Promise { - return new Promise((resolve, reject) => { - readdir(pathToDir, async (err, files) => { - if (err) { - return reject(err) - } - const importPromises = files - .filter((file) => file.endsWith('.js') && isWhitelistedFileName(file)) - .map((file) => import(`${pathToDir}/${file}`)) - resolve(Promise.all(importPromises)) - }) - }) - - function isWhitelistedFileName(fileName: string) { - // No whitelist means all files are whitelisted - if (!Array.isArray(whitelistedFileNames)) { - return true - } - - return whitelistedFileNames.some((whitelistedFileName) => fileName === whitelistedFileName) - } -} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/tsconfig.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/tsconfig.json index f0ce78775e..68d7a47b0d 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/tsconfig.json +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/tsconfig.json @@ -2,7 +2,33 @@ "extends": "@tsconfig/node18/tsconfig.json", "compilerOptions": { // Overriding this until we implement more complete TypeScript support. + // Filip: begin client file hacks + // We need this to make server work with copied client files (we copy everything) + "jsx": "preserve", + "lib": [ + "esnext", + "dom", + "DOM.Iterable" + ], + // Filip: end client file hacks "strict": false, + // When left unspecified, the 'rootDir' defaults to the longest common path of + // all non-declaration input files. TypeScript mimics the source structure + // inside the output directory (i.e., 'dist'). + // + // Since Wasp apps can (but don't have to) import user files from + // '../../../src', it makes the rootDir's default value inconsistent: + // - When the app doesn't import user files (e.g., the user didn't specify + // any operations), the rootDir is set to the server source dir (/src). + // - When the app imports user files (as is the case for most Wasp apps), + // the rootDir is set to the Wasp project root (../../../). + // + // Our build script (in package.json) requires a consistent structure of + // the output directory, which is why we always make sure to point the rootDir + // to the Wasp project root (../../../). + // + // See this comment for more details: https://github.com/wasp-lang/wasp/pull/1584#discussion_r1404019301 + "rootDir": "../../../", // Overriding this because we want to use top-level await "module": "esnext", "target": "es2017", @@ -10,12 +36,13 @@ "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 }, - "include": ["src"] -} + "include": [ + "src" + ] +} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/package.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/package.json index a0cae5594c..1b275ba8c4 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/package.json +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/package.json @@ -12,38 +12,24 @@ ] }, "dependencies": { - "@prisma/client": "4.16.2", - "@stitches/react": "^1.2.8", "@tanstack/react-query": "^4.29.0", "axios": "^1.4.0", "mitt": "3.0.0", - "react": "^18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.45.4", - "react-redux": "^7.1.3", "react-router-dom": "^5.3.3", - "redux": "^4.0.5", "superjson": "^1.12.2" }, "devDependencies": { - "@testing-library/jest-dom": "^5.16.5", - "@testing-library/react": "^14.0.0", "@tsconfig/vite-react": "^2.0.0", - "@types/react": "^18.0.37", "@types/react-dom": "^18.0.11", "@types/react-router-dom": "^5.3.3", - "@vitejs/plugin-react-swc": "^3.0.0", - "@vitest/ui": "^0.29.3", - "dotenv": "^16.0.3", - "jsdom": "^21.1.1", - "msw": "^1.1.0", - "typescript": "^5.1.0", - "vite": "^4.3.9", - "vitest": "^0.29.3" + "@vitejs/plugin-react": "^4.2.1", + "dotenv": "^16.0.3" }, "engineStrict": true, "engines": { - "node": ">=18.0.0" + "node": ">=18.18.0" }, "name": "waspComplexTest", "private": true, diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/public/.gitkeep b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/public/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/scripts/universal/validators.mjs b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/scripts/universal/validators.mjs deleted file mode 100644 index 9e3605d3b5..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/scripts/universal/validators.mjs +++ /dev/null @@ -1,21 +0,0 @@ -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`); - } -} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/scripts/validate-env.mjs index 27d6a9fd59..18ee507c9e 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/scripts/validate-env.mjs +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/scripts/validate-env.mjs @@ -1,4 +1,4 @@ -import { throwIfNotValidAbsoluteURL } from './universal/validators.mjs'; +import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; console.info("🔍 Validating environment variables..."); throwIfNotValidAbsoluteURL(process.env.REACT_APP_API_URL, 'Environemnt variable REACT_APP_API_URL'); diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/actions/MySpecialAction.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/actions/MySpecialAction.ts deleted file mode 100644 index b50524ff50..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/actions/MySpecialAction.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { createAction } from './core' -import { MySpecialAction } from '../../../server/src/actions/MySpecialAction' - -const action = createAction( - 'operations/my-special-action', - ['User'], -) - -export default action diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/pages/OAuthCodeExchange.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/pages/OAuthCodeExchange.jsx index 490f76d0ad..2674272eaf 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/pages/OAuthCodeExchange.jsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/pages/OAuthCodeExchange.jsx @@ -1,9 +1,9 @@ import React, { useEffect, useRef } from 'react' import { useHistory } from 'react-router-dom' -import config from '../../config.js' -import api from '../../api' -import { initSession } from '../helpers/user' +import config from 'wasp/core/config' +import { api } from 'wasp/client/api' +import { initSession } from 'wasp/auth/helpers/user' // After a user authenticates via an Oauth 2.0 provider, this is the page that // the provider should redirect them to, while providing query string parameters diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/pages/createAuthRequiredPage.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/pages/createAuthRequiredPage.jsx index 621ef393d9..f7828da186 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/pages/createAuthRequiredPage.jsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/pages/createAuthRequiredPage.jsx @@ -1,7 +1,7 @@ import React from 'react' import { Redirect } from 'react-router-dom' -import useAuth from '../useAuth' +import { useAuth } from 'wasp/client/auth' const createAuthRequiredPage = (Page) => { diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/types.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/types.ts deleted file mode 100644 index 637a2e13d4..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/types.ts +++ /dev/null @@ -1,2 +0,0 @@ -// todo(filip): turn into a proper import/path -export type { SanitizedUser as User, ProviderName, DeserializedAuthIdentity } from '../../../server/src/_types/' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/user.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/user.ts deleted file mode 100644 index aa0da24824..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/auth/user.ts +++ /dev/null @@ -1,27 +0,0 @@ -// We decided not to deduplicate these helper functions in the server and the client. -// We have them duplicated in this file and in data/Generator/templates/server/src/auth/user.ts -// If you are changing the logic here, make sure to change it there as well. - -import type { User, ProviderName, DeserializedAuthIdentity } from './types' - -export function getEmail(user: User): string | null { - return findUserIdentity(user, "email")?.providerUserId ?? null; -} - -export function getUsername(user: User): string | null { - return findUserIdentity(user, "username")?.providerUserId ?? null; -} - -export function getFirstProviderUserId(user?: User): string | null { - if (!user || !user.auth || !user.auth.identities || user.auth.identities.length === 0) { - return null; - } - - return user.auth.identities[0].providerUserId ?? null; -} - -export function findUserIdentity(user: User, providerName: ProviderName): DeserializedAuthIdentity | undefined { - return user.auth.identities.find( - (identity) => identity.providerName === providerName - ); -} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/MainPage.jsx deleted file mode 100644 index c53ad8abaa..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/MainPage.jsx +++ /dev/null @@ -1,40 +0,0 @@ -import waspLogo from './waspLogo.png' -import './Main.css' - -const 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. -

- - -
-
- ) -} -export default MainPage diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/vite-env.d.ts deleted file mode 100644 index 1623b9c79c..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/index.tsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/index.tsx index f8a13273f0..dceb898183 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/index.tsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/index.tsx @@ -6,9 +6,9 @@ import router from './router' import { initializeQueryClient, queryClientInitialized, -} from './queryClient' +} from 'wasp/client/operations' -import myClientSetupFunction from './ext-src/myClientSetupCode.js' +import myClientSetupFunction from '../../../../src/client/myClientSetupCode.js' startApp() diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/MySpecialQuery.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/MySpecialQuery.ts deleted file mode 100644 index 2618d1cf94..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/MySpecialQuery.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { createQuery } from './core' -import { MySpecialQuery } from '../../../server/src/queries/MySpecialQuery' - - -const query = createQuery( - 'operations/my-special-query', - ['User'], -) - -export default query diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/index.d.ts deleted file mode 100644 index c007ff4c92..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { UseQueryResult } from "@tanstack/react-query"; - -export type Query = { - (queryCacheKey: string[], args: Input): Promise -} - -export function useQuery( - queryFn: Query, - queryFnArgs?: Input, options?: any -): UseQueryResult diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/index.js deleted file mode 100644 index 03e52ce0f9..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/index.js +++ /dev/null @@ -1,18 +0,0 @@ -import { useQuery as rqUseQuery } from '@tanstack/react-query' -export { configureQueryClient } from '../queryClient' - -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 - }) -} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/router.tsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/router.tsx index c243863dec..83c2871369 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/router.tsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/router.tsx @@ -1,30 +1,18 @@ import React from 'react' import { Route, Switch, BrowserRouter as Router } from 'react-router-dom' -import { interpolatePath } from './router/linkHelpers' -import type { - RouteDefinitionsToRoutes, - OptionalRouteOptions, - ParamValue, -} from './router/types' -import App from './ext-src/App.jsx' +import App from '../../../../src/client/App.jsx' import createAuthRequiredPage from "./auth/pages/createAuthRequiredPage" -import MainPage from './ext-src/MainPage.jsx' +import { MainPage } from '../../../../src/MainPage.jsx' import OAuthCodeExchange from "./auth/pages/OAuthCodeExchange" -export const routes = { - RootRoute: { - to: "/", - component: MainPage, - build: ( - options?: OptionalRouteOptions, - ) => interpolatePath("/", undefined, options.search, options.hash), - }, -} as const; +import { routes } from 'wasp/client/router' -export type Routes = RouteDefinitionsToRoutes +export const routeNameToRouteComponent = { + RootRoute: MainPage, +} as const; const router = ( @@ -35,7 +23,7 @@ const router = ( exact key={routeKey} path={route.to} - component={route.component} + component={routeNameToRouteComponent[routeKey]} /> ))} @@ -47,5 +35,3 @@ const router = ( ) export default router - -export { Link } from './router/Link' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/test/vitest/setup.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/test/vitest/setup.ts index d263e51f4f..f62fc46590 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/test/vitest/setup.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/test/vitest/setup.ts @@ -1,4 +1,8 @@ -import matchers from '@testing-library/jest-dom/matchers' -import { expect } from 'vitest' +import { afterEach } from 'vitest' +import { cleanup } from '@testing-library/react' +import '@testing-library/jest-dom/vitest' -expect.extend(matchers) +// runs a clean after each test case (e.g. clearing jsdom) +afterEach(() => { + cleanup(); +}) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/universal/types.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/universal/types.ts deleted file mode 100644 index 8cadbd740d..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/universal/types.ts +++ /dev/null @@ -1,31 +0,0 @@ -// 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/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/universal/url.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/universal/url.ts deleted file mode 100644 index d21c06c65c..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/universal/url.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function stripTrailingSlash(url?: string): string | undefined { - return url?.replace(/\/$/, ""); -} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/tsconfig.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/tsconfig.json index 968a1bb47f..4e7d14e1cd 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/tsconfig.json +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/tsconfig.json @@ -6,8 +6,14 @@ "allowJs": true, "strict": false, // Allow importing pages with the .tsx extension. - "allowImportingTsExtensions": true + "allowImportingTsExtensions": true, }, - "include": ["src"], - "references": [{ "path": "./tsconfig.node.json" }] -} + "include": [ + "src" + ], + "references": [ + { + "path": "./tsconfig.node.json" + } + ] +} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/vite.config.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/vite.config.ts index 0bc670f493..ed2d3dd5f0 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/vite.config.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/vite.config.ts @@ -1,13 +1,19 @@ /// import { mergeConfig } from "vite"; -import react from "@vitejs/plugin-react-swc"; +import react from "@vitejs/plugin-react"; +import { defaultExclude } from "vitest/config" -import customViteConfig from './src/ext-src/vite.config' +// Ignoring the TS error because we are importing a file outside of TS root dir. +// @ts-ignore +import customViteConfig from '../../../vite.config' const _waspUserProvidedConfig = customViteConfig const defaultViteConfig = { base: "/", plugins: [react()], + optimizeDeps: { + exclude: ['wasp'] + }, server: { port: 3000, host: "0.0.0.0", @@ -17,9 +23,22 @@ const defaultViteConfig = { build: { outDir: "build", }, + resolve: { + // These packages rely on a single instance per page. Not dedpuing them + // causes runtime errors (e.g., hook rule violation in react, QueryClient + // instance error in react-query, Invariant Error in react-router-dom). + dedupe: ["react", "react-dom", "@tanstack/react-query", "react-router-dom"] + }, test: { + globals: true, environment: "jsdom", - setupFiles: ["./src/test/vitest/setup.ts"], + // Since Vitest is running from the root of the project, we need + // to specify the path to the setup file relative to the root. + setupFiles: ['.wasp/out/web-app/src/test/vitest/setup.ts'], + exclude: [ + ...defaultExclude, + ".wasp/**/*", + ] }, }; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/.waspignore b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.waspignore similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/.waspignore rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.waspignore diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/main.wasp b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/main.wasp index 5fab63309b..b0a23b21f7 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/main.wasp +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/main.wasp @@ -13,12 +13,12 @@ app waspComplexTest { }, server: { - setupFn: import mySetupFunction from "@server/myServerSetupCode.js", + setupFn: import mySetupFunction from "@src/server/myServerSetupCode.js", }, client: { - setupFn: import myClientSetupFunction from "@client/myClientSetupCode.js", - rootComponent: import App from "@client/App.jsx" + setupFn: import myClientSetupFunction from "@src/client/myClientSetupCode.js", + rootComponent: import App from "@src/client/App.jsx" }, emailSender: { @@ -29,17 +29,12 @@ app waspComplexTest { }, }, - dependencies: [ - ("redux", "^4.0.5"), - ("react-redux", "^7.1.3") - ], - title: "waspComplexTest" } route RootRoute { path: "/", to: MainPage } page MainPage { - component: import Main from "@client/MainPage.jsx" + component: import { MainPage } from "@src/MainPage.jsx" } entity User {=psl id Int @id @default(autoincrement()) @@ -58,44 +53,44 @@ entity SocialLogin {=psl @@unique([provider, providerId, userId]) psl=} -job MySpecialJob { +job mySpecialJob { executor: PgBoss, perform: { - fn: import { foo } from "@server/jobs/bar.js" + fn: import { foo } from "@src/server/jobs/bar.js" } } -job ReturnHelloJob { +job returnHelloJob { executor: PgBoss, perform: { - fn: import { returnHello } from "@server/jobs/returnHello.js", + fn: import { returnHello } from "@src/server/jobs/returnHello.js", }, entities: [User], } -action MySpecialAction { - fn: import { foo } from "@server/actions/bar.js", +action mySpecialAction { + fn: import { foo } from "@src/server/actions/bar.js", entities: [User], } -query MySpecialQuery { - fn: import { foo } from "@server/queries/bar.js", +query mySpecialQuery { + fn: import { foo } from "@src/server/queries/bar.js", entities: [User], } api fooBar { - fn: import { fooBar } from "@server/apis.js", + fn: import { fooBar } from "@src/server/apis.js", httpRoute: (GET, "/foo/bar"), - middlewareConfigFn: import { fooBarMiddlewareFn } from "@server/apis.js" + middlewareConfigFn: import { fooBarMiddlewareFn } from "@src/server/apis.js" } api fooBaz { - fn: import { fooBaz } from "@server/apis.js", + fn: import { fooBaz } from "@src/server/apis.js", httpRoute: (GET, "/foo/baz"), auth: false } apiNamespace fooBarNamespace { - middlewareConfigFn: import { fooBarNamespaceMiddlewareFn } from "@server/apiNamespaces.js", + middlewareConfigFn: import { fooBarNamespaceMiddlewareFn } from "@src/server/apiNamespaces.js", path: "/bar" } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/package.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/package.json new file mode 100644 index 0000000000..a38f9cccf8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/package.json @@ -0,0 +1,15 @@ +{ + "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": "waspComplexTest", + "react-redux": "^7.1.3", + "redux": "^4.0.5" +} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/public/.gitkeep b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/public/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/client/Main.css b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/Main.css similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/client/Main.css rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/Main.css diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/MainPage.jsx new file mode 100644 index 0000000000..01aae7c3db --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/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/waspComplexTest-golden/waspComplexTest/src/client/MainPage.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/client/MainPage.jsx deleted file mode 100644 index c53ad8abaa..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/client/MainPage.jsx +++ /dev/null @@ -1,40 +0,0 @@ -import waspLogo from './waspLogo.png' -import './Main.css' - -const 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. -

- - -
-
- ) -} -export default MainPage diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/client/tsconfig.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/client/tsconfig.json deleted file mode 100644 index d501a4193a..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/client/tsconfig.json +++ /dev/null @@ -1,55 +0,0 @@ -// =============================== IMPORTANT ================================= -// -// This file is only used for Wasp IDE support. You can change it to configure -// your IDE checks, but none of these options will affect the TypeScript -// compiler. Proper TS compiler configuration in Wasp is coming soon :) -{ - "compilerOptions": { - // JSX support - "jsx": "preserve", - "strict": true, - // Allow default imports. - "esModuleInterop": true, - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - // Wasp needs the following settings enable IDE support in your source - // files. Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/web-app/", - "paths": { - // Resolve all "@wasp" imports to the generated source code. - "@wasp/*": [ - "src/*" - ], - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": [ - "../../.wasp/out/web-app/node_modules/@types" - ], - // Since this TS config is used only for IDE support and not for - // compilation, the following directory doesn't exist. We need to specify - // it to prevent this error: - // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file - "outDir": "phantom" - }, - "exclude": [ - "phantom" - ], -} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/client/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/client/vite-env.d.ts deleted file mode 100644 index 1623b9c79c..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/client/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/server/apiNamespaces.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/server/apiNamespaces.ts index eb117924ac..e44a461b4b 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/server/apiNamespaces.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/server/apiNamespaces.ts @@ -1,4 +1,4 @@ -import { MiddlewareConfigFn } from '@wasp/middleware' +import { MiddlewareConfigFn } from 'wasp/server' export const fooBarNamespaceMiddlewareFn: MiddlewareConfigFn = (middlewareConfig) => { return middlewareConfig } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/server/apis.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/server/apis.ts index b45154335a..04d497415a 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/server/apis.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/server/apis.ts @@ -1,5 +1,5 @@ -import { FooBar, FooBaz } from '@wasp/apis/types' -import { MiddlewareConfigFn } from '@wasp/middleware' +import { FooBar, FooBaz } from 'wasp/server/api' +import { MiddlewareConfigFn } from 'wasp/server' export const fooBar: FooBar = (req, res, context) => { res.set('Access-Control-Allow-Origin', '*') res.json({ msg: 'Hello, context.user.username!' }) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/server/jobs/returnHello.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/server/jobs/returnHello.ts index 3a579801fa..89d9ac5603 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/server/jobs/returnHello.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/server/jobs/returnHello.ts @@ -1,4 +1,4 @@ -import { ReturnHelloJob } from '@wasp/jobs/ReturnHelloJob' +import { ReturnHelloJob } from 'wasp/server/jobs' export const returnHello: ReturnHelloJob<{ name: string }, string> = async (args) => { return args.name } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/server/tsconfig.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/server/tsconfig.json deleted file mode 100644 index 70a79b44ee..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/server/tsconfig.json +++ /dev/null @@ -1,48 +0,0 @@ -// =============================== IMPORTANT ================================= -// -// This file is only used for Wasp IDE support. You can change it to configure -// your IDE checks, but none of these options will affect the TypeScript -// compiler. Proper TS compiler configuration in Wasp is coming soon :) -{ - "compilerOptions": { - // Allows default imports. - "esModuleInterop": true, - "allowJs": true, - "strict": true, - // Wasp needs the following settings enable IDE support in your source - // files. Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/server/", - "paths": { - // Resolve all "@wasp" imports to the generated source code. - "@wasp/*": [ - "src/*" - ], - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": [ - "../../.wasp/out/server/node_modules/@types" - ], - // Since this TS config is used only for IDE support and not for - // compilation, the following directory doesn't exist. We need to specify - // it to prevent this error: - // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file - "outDir": "phantom", - }, - "exclude": [ - "phantom" - ], -} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/shared/tsconfig.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/shared/tsconfig.json deleted file mode 100644 index 20fcac8431..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/shared/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - // Enable default imports in TypeScript. - "esModuleInterop": true, - "allowJs": true, - // The following settings enable IDE support in user-provided source files. - // Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/server/", - "paths": { - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": ["../../.wasp/out/server/node_modules/@types"] - } -} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/client/waspLogo.png b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/waspLogo.png similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/client/waspLogo.png rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/waspLogo.png diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/tsconfig.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/tsconfig.json new file mode 100644 index 0000000000..a05fb4efd3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/tsconfig.json @@ -0,0 +1,34 @@ +// =============================== IMPORTANT ================================= +// +// This file is only used for Wasp IDE support. You can change it to configure +// your IDE checks, but none of these options will affect the TypeScript +// compiler. Proper TS compiler configuration in Wasp is coming soon :) +{ + "compilerOptions": { + // JSX support + "jsx": "preserve", + "strict": true, + // Allow default imports. + "esModuleInterop": true, + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "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" + ], + // Since this TS config is used only for IDE support and not for + // compilation, the following directory doesn't exist. We need to specify + // it to prevent this error: + // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file + "outDir": "phantom", + }, + "exclude": [ + "phantom" + ], +} diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/ext-src/vite.config.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/vite.config.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/ext-src/vite.config.ts rename to waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/vite.config.ts diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest b/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest index 91b05f149a..2ec6c75a34 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest @@ -3,31 +3,230 @@ waspJob/.wasp/out/.dockerignore waspJob/.wasp/out/.waspchecksums waspJob/.wasp/out/Dockerfile waspJob/.wasp/out/db/schema.prisma -waspJob/.wasp/out/installedFullStackNpmDependencies.json +waspJob/.wasp/out/installedNpmDepsLog.json +waspJob/.wasp/out/sdk/wasp/api/events.ts +waspJob/.wasp/out/sdk/wasp/api/index.ts +waspJob/.wasp/out/sdk/wasp/client/index.ts +waspJob/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts +waspJob/.wasp/out/sdk/wasp/client/operations/actions/core.js +waspJob/.wasp/out/sdk/wasp/client/operations/actions/index.ts +waspJob/.wasp/out/sdk/wasp/client/operations/core.ts +waspJob/.wasp/out/sdk/wasp/client/operations/index.ts +waspJob/.wasp/out/sdk/wasp/client/operations/internal/index.ts +waspJob/.wasp/out/sdk/wasp/client/operations/internal/resources.js +waspJob/.wasp/out/sdk/wasp/client/operations/internal/updateHandlersMap.js +waspJob/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts +waspJob/.wasp/out/sdk/wasp/client/operations/queries/core.js +waspJob/.wasp/out/sdk/wasp/client/operations/queries/index.ts +waspJob/.wasp/out/sdk/wasp/client/operations/queryClient.ts +waspJob/.wasp/out/sdk/wasp/client/router/Link.tsx +waspJob/.wasp/out/sdk/wasp/client/router/index.ts +waspJob/.wasp/out/sdk/wasp/client/router/linkHelpers.ts +waspJob/.wasp/out/sdk/wasp/client/router/types.ts +waspJob/.wasp/out/sdk/wasp/client/test/index.ts +waspJob/.wasp/out/sdk/wasp/client/test/vitest/helpers.tsx +waspJob/.wasp/out/sdk/wasp/core/config.ts +waspJob/.wasp/out/sdk/wasp/core/storage.ts +waspJob/.wasp/out/sdk/wasp/dev/index.ts +waspJob/.wasp/out/sdk/wasp/dist/api/events.d.ts +waspJob/.wasp/out/sdk/wasp/dist/api/events.js +waspJob/.wasp/out/sdk/wasp/dist/api/events.js.map +waspJob/.wasp/out/sdk/wasp/dist/api/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/api/index.js +waspJob/.wasp/out/sdk/wasp/dist/api/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/client/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/index.js +waspJob/.wasp/out/sdk/wasp/dist/client/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js +waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map +waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js +waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/operations/core.js +waspJob/.wasp/out/sdk/wasp/dist/client/operations/core.js.map +waspJob/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/operations/index.js +waspJob/.wasp/out/sdk/wasp/dist/client/operations/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js +waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js +waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map +waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js +waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map +waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js +waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map +waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js +waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js +waspJob/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map +waspJob/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/router/Link.jsx +waspJob/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map +waspJob/.wasp/out/sdk/wasp/dist/client/router/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/router/index.js +waspJob/.wasp/out/sdk/wasp/dist/client/router/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js +waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map +waspJob/.wasp/out/sdk/wasp/dist/client/router/types.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/router/types.js +waspJob/.wasp/out/sdk/wasp/dist/client/router/types.js.map +waspJob/.wasp/out/sdk/wasp/dist/client/test/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/test/index.js +waspJob/.wasp/out/sdk/wasp/dist/client/test/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx +waspJob/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map +waspJob/.wasp/out/sdk/wasp/dist/core/config.d.ts +waspJob/.wasp/out/sdk/wasp/dist/core/config.js +waspJob/.wasp/out/sdk/wasp/dist/core/config.js.map +waspJob/.wasp/out/sdk/wasp/dist/core/storage.d.ts +waspJob/.wasp/out/sdk/wasp/dist/core/storage.js +waspJob/.wasp/out/sdk/wasp/dist/core/storage.js.map +waspJob/.wasp/out/sdk/wasp/dist/dev/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/dev/index.js +waspJob/.wasp/out/sdk/wasp/dist/dev/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/entities/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/entities/index.js +waspJob/.wasp/out/sdk/wasp/dist/entities/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts +waspJob/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx +waspJob/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map +waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.d.ts +waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js +waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js +waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/_types/index.js +waspJob/.wasp/out/sdk/wasp/dist/server/_types/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/_types/serialization.js +waspJob/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js +waspJob/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/config.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/config.js +waspJob/.wasp/out/sdk/wasp/dist/server/config.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/dbClient.js +waspJob/.wasp/out/sdk/wasp/dist/server/dbClient.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/index.js +waspJob/.wasp/out/sdk/wasp/dist/server/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/job.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js +waspJob/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/middleware/index.js +waspJob/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js +waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js +waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/operations/index.js +waspJob/.wasp/out/sdk/wasp/dist/server/operations/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js +waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js +waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/types/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/types/index.js +waspJob/.wasp/out/sdk/wasp/dist/server/types/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/utils.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/utils.js +waspJob/.wasp/out/sdk/wasp/dist/server/utils.js.map +waspJob/.wasp/out/sdk/wasp/dist/universal/types.d.ts +waspJob/.wasp/out/sdk/wasp/dist/universal/types.js +waspJob/.wasp/out/sdk/wasp/dist/universal/types.js.map +waspJob/.wasp/out/sdk/wasp/dist/universal/url.d.ts +waspJob/.wasp/out/sdk/wasp/dist/universal/url.js +waspJob/.wasp/out/sdk/wasp/dist/universal/url.js.map +waspJob/.wasp/out/sdk/wasp/dist/universal/validators.d.ts +waspJob/.wasp/out/sdk/wasp/dist/universal/validators.js +waspJob/.wasp/out/sdk/wasp/dist/universal/validators.js.map +waspJob/.wasp/out/sdk/wasp/entities/index.ts +waspJob/.wasp/out/sdk/wasp/ext-src/Main.css +waspJob/.wasp/out/sdk/wasp/ext-src/MainPage.jsx +waspJob/.wasp/out/sdk/wasp/ext-src/server/jobs/bar.js +waspJob/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts +waspJob/.wasp/out/sdk/wasp/ext-src/waspLogo.png +waspJob/.wasp/out/sdk/wasp/package.json +waspJob/.wasp/out/sdk/wasp/server/HttpError.ts +waspJob/.wasp/out/sdk/wasp/server/_types/index.ts +waspJob/.wasp/out/sdk/wasp/server/_types/serialization.ts +waspJob/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts +waspJob/.wasp/out/sdk/wasp/server/config.ts +waspJob/.wasp/out/sdk/wasp/server/dbClient.ts +waspJob/.wasp/out/sdk/wasp/server/index.ts +waspJob/.wasp/out/sdk/wasp/server/jobs/core/job.ts +waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/index.ts +waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts +waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts +waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/types.ts +waspJob/.wasp/out/sdk/wasp/server/jobs/index.ts +waspJob/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts +waspJob/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts +waspJob/.wasp/out/sdk/wasp/server/middleware/index.ts +waspJob/.wasp/out/sdk/wasp/server/operations/actions/index.ts +waspJob/.wasp/out/sdk/wasp/server/operations/actions/types.ts +waspJob/.wasp/out/sdk/wasp/server/operations/index.ts +waspJob/.wasp/out/sdk/wasp/server/operations/queries/index.ts +waspJob/.wasp/out/sdk/wasp/server/operations/queries/types.ts +waspJob/.wasp/out/sdk/wasp/server/types/index.ts +waspJob/.wasp/out/sdk/wasp/server/utils.ts +waspJob/.wasp/out/sdk/wasp/tsconfig.json +waspJob/.wasp/out/sdk/wasp/universal/types.ts +waspJob/.wasp/out/sdk/wasp/universal/url.ts +waspJob/.wasp/out/sdk/wasp/universal/validators.ts +waspJob/.wasp/out/sdk/wasp/vite-env.d.ts waspJob/.wasp/out/server/.env waspJob/.wasp/out/server/.npmrc waspJob/.wasp/out/server/README.md waspJob/.wasp/out/server/nodemon.json waspJob/.wasp/out/server/package.json -waspJob/.wasp/out/server/scripts/universal/validators.mjs +waspJob/.wasp/out/server/rollup.config.js waspJob/.wasp/out/server/scripts/validate-env.mjs -waspJob/.wasp/out/server/src/_types/index.ts -waspJob/.wasp/out/server/src/_types/serialization.ts -waspJob/.wasp/out/server/src/_types/taggedEntities.ts waspJob/.wasp/out/server/src/actions/types.ts waspJob/.wasp/out/server/src/app.js -waspJob/.wasp/out/server/src/config.js -waspJob/.wasp/out/server/src/core/AuthError.js -waspJob/.wasp/out/server/src/core/HttpError.js -waspJob/.wasp/out/server/src/dbClient.ts -waspJob/.wasp/out/server/src/dbSeed/types.ts -waspJob/.wasp/out/server/src/entities/index.ts -waspJob/.wasp/out/server/src/ext-src/jobs/bar.js -waspJob/.wasp/out/server/src/jobs/MySpecialJob.ts waspJob/.wasp/out/server/src/jobs/core/allJobs.ts -waspJob/.wasp/out/server/src/jobs/core/job.ts -waspJob/.wasp/out/server/src/jobs/core/pgBoss/pgBoss.ts -waspJob/.wasp/out/server/src/jobs/core/pgBoss/pgBossJob.ts +waspJob/.wasp/out/server/src/jobs/mySpecialJob.ts waspJob/.wasp/out/server/src/middleware/globalMiddleware.ts waspJob/.wasp/out/server/src/middleware/index.ts waspJob/.wasp/out/server/src/middleware/operations.ts @@ -36,10 +235,6 @@ waspJob/.wasp/out/server/src/queries/types.ts waspJob/.wasp/out/server/src/routes/index.js waspJob/.wasp/out/server/src/routes/operations/index.js waspJob/.wasp/out/server/src/server.ts -waspJob/.wasp/out/server/src/types/index.ts -waspJob/.wasp/out/server/src/universal/types.ts -waspJob/.wasp/out/server/src/universal/url.ts -waspJob/.wasp/out/server/src/utils.ts waspJob/.wasp/out/server/tsconfig.json waspJob/.wasp/out/web-app/.env waspJob/.wasp/out/web-app/.npmrc @@ -47,57 +242,30 @@ waspJob/.wasp/out/web-app/README.md waspJob/.wasp/out/web-app/index.html waspJob/.wasp/out/web-app/netlify.toml waspJob/.wasp/out/web-app/package.json +waspJob/.wasp/out/web-app/public/.gitkeep waspJob/.wasp/out/web-app/public/favicon.ico waspJob/.wasp/out/web-app/public/manifest.json -waspJob/.wasp/out/web-app/scripts/universal/validators.mjs waspJob/.wasp/out/web-app/scripts/validate-env.mjs -waspJob/.wasp/out/web-app/src/actions/core.d.ts -waspJob/.wasp/out/web-app/src/actions/core.js -waspJob/.wasp/out/web-app/src/actions/index.ts -waspJob/.wasp/out/web-app/src/api.ts -waspJob/.wasp/out/web-app/src/api/events.ts -waspJob/.wasp/out/web-app/src/config.js waspJob/.wasp/out/web-app/src/entities/index.ts -waspJob/.wasp/out/web-app/src/ext-src/Main.css -waspJob/.wasp/out/web-app/src/ext-src/MainPage.jsx -waspJob/.wasp/out/web-app/src/ext-src/vite-env.d.ts -waspJob/.wasp/out/web-app/src/ext-src/vite.config.ts -waspJob/.wasp/out/web-app/src/ext-src/waspLogo.png waspJob/.wasp/out/web-app/src/index.tsx waspJob/.wasp/out/web-app/src/logo.png -waspJob/.wasp/out/web-app/src/operations/index.ts -waspJob/.wasp/out/web-app/src/operations/resources.js -waspJob/.wasp/out/web-app/src/operations/updateHandlersMap.js -waspJob/.wasp/out/web-app/src/queries/core.d.ts -waspJob/.wasp/out/web-app/src/queries/core.js -waspJob/.wasp/out/web-app/src/queries/index.d.ts -waspJob/.wasp/out/web-app/src/queries/index.js waspJob/.wasp/out/web-app/src/queryClient.js waspJob/.wasp/out/web-app/src/router.tsx -waspJob/.wasp/out/web-app/src/router/Link.tsx -waspJob/.wasp/out/web-app/src/router/linkHelpers.ts -waspJob/.wasp/out/web-app/src/router/types.ts -waspJob/.wasp/out/web-app/src/storage.ts -waspJob/.wasp/out/web-app/src/test/index.ts -waspJob/.wasp/out/web-app/src/test/vitest/helpers.tsx waspJob/.wasp/out/web-app/src/test/vitest/setup.ts -waspJob/.wasp/out/web-app/src/types.ts -waspJob/.wasp/out/web-app/src/universal/types.ts -waspJob/.wasp/out/web-app/src/universal/url.ts waspJob/.wasp/out/web-app/src/utils.js waspJob/.wasp/out/web-app/src/vite-env.d.ts waspJob/.wasp/out/web-app/tsconfig.json waspJob/.wasp/out/web-app/tsconfig.node.json waspJob/.wasp/out/web-app/vite.config.ts +waspJob/.waspignore waspJob/.wasproot waspJob/main.wasp -waspJob/src/.waspignore -waspJob/src/client/Main.css -waspJob/src/client/MainPage.jsx -waspJob/src/client/tsconfig.json -waspJob/src/client/vite-env.d.ts -waspJob/src/client/vite.config.ts -waspJob/src/client/waspLogo.png +waspJob/package.json +waspJob/public/.gitkeep +waspJob/src/Main.css +waspJob/src/MainPage.jsx waspJob/src/server/jobs/bar.js -waspJob/src/server/tsconfig.json -waspJob/src/shared/tsconfig.json +waspJob/src/vite-env.d.ts +waspJob/src/waspLogo.png +waspJob/tsconfig.json +waspJob/vite.config.ts diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/.waspchecksums b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/.waspchecksums index f9f7edfd5e..82d2fe2894 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/.waspchecksums @@ -2,597 +2,702 @@ [ [ "file", - ".dockerignore" + "../out/sdk/wasp/api/events.ts" ], - "a2a5ebe3785244437c0d490b4bfa1652c84b9ab0d4f25566fd7e69d1421d7a1b" + "91ec1889f649b608ca81cab8f048538b9dcc70f49444430b1e5b572af2a4970a" ], [ [ "file", - "Dockerfile" + "../out/sdk/wasp/api/index.ts" ], - "61df2044110c16c48bfe89f0798c689c256598cb6cbc37f9ea69b69ee6ffe2a4" + "6d69f0df651dd19d0a9cd137ee4a0d536358269b6bd91c25efaa6c254f06948a" ], [ [ "file", - "db/schema.prisma" + "../out/sdk/wasp/client/index.ts" ], - "6f7b1b109e332bad9eb3cda4a2caf4963f4918c91b546c06fa42d8986c0b94a2" + "526d2f787c68b0be87064eb4c7771394f2987b6669b5fd39f9d240dcbfc2356c" ], [ [ "file", - "server/.env" + "../out/sdk/wasp/client/operations/actions/core.d.ts" ], - "b267ea48e5ff257c153b4f84102104eec7af8a46827aae6e76fc42c83934cfc0" + "676855c039620769cc6ac728149d263c438024e5888ea0afd7f575507a95682a" ], [ [ "file", - "server/.gitignore" + "../out/sdk/wasp/client/operations/actions/core.js" ], - "2c3d81dd719ff91d51609a02d03ba62ad456e2c50763b7b4c761395cb583f890" + "620a4aefbab701dd47b8bf21a07fc4e081ae1fd297261c5af7a05f21f558dff1" ], [ [ "file", - "server/.npmrc" + "../out/sdk/wasp/client/operations/actions/index.ts" ], - "8a74b1091affea3c71c2cf04acbaa38c4a51a261a9a98dcc9e96473d07a85a27" + "cada58ebdd19f239b97a4cc6bfc1d37b855022629457ddb0c03ff9317aa8e8f0" ], [ [ "file", - "server/README.md" + "../out/sdk/wasp/client/operations/core.ts" ], - "e14514b8b152dd2160a217d8fc66a710c8607c4ed1441a2148a0770701818249" + "bad860771b16a0d4830fab22de8b85e63c840d47dc3728728a23b8ada91061ef" ], [ [ "file", - "server/nodemon.json" + "../out/sdk/wasp/client/operations/index.ts" ], - "c4c69994805c8e0d993bd39fec9e52478b5e656bae565fa1c19ef378901a7139" + "4a66c90319dd7ef0d3a8e6c1f571037c7dfd9778b9def6e951813dbc4b4dcef3" ], [ [ "file", - "server/package.json" + "../out/sdk/wasp/client/operations/internal/index.ts" ], - "dff79e67dd655049c93ff392f6ed0cd5b89b7f501e791bc4188d80913236be2e" + "0cd5c744f0d883d48a6c1ddf8eacbe48059e123e79c5f39fad2d17073b6c9f9e" ], [ [ "file", - "server/scripts/universal/validators.mjs" + "../out/sdk/wasp/client/operations/internal/resources.js" ], - "94edf3906c43fb476b22244d07a5d69fd6c967de767532ed5b3215e2a6eee91b" + "0f3a0e4d19ceff419a6343ab5162d8b0985673f9d3d7d76bd4471fae0076fe17" ], [ [ "file", - "server/scripts/validate-env.mjs" + "../out/sdk/wasp/client/operations/internal/updateHandlersMap.js" ], - "b507ff0f8cbdac18a0b42ccbb7acda9a5cd88e0ac5f95ca3d42341944298062d" + "07a9933a771853585fd2fc49c3dcb9f1cad947acb2168580c835fae25620fa9f" ], [ [ "file", - "server/src/_types/index.ts" + "../out/sdk/wasp/client/operations/queries/core.d.ts" ], - "b6b5d08ff823cf66d47932167a4008307acb53cef2e409f26621e8b268ba8008" + "8ca19541652926772e2a7c5d88b5497b7760e98bc9d19c9a217bd03d83cec97d" ], [ [ "file", - "server/src/_types/serialization.ts" + "../out/sdk/wasp/client/operations/queries/core.js" ], - "73dc983c9a02cab8e2f189f1ddedd9cdcd47bf403c9dc56efba8be895b6980a1" + "34425abc901cd6294ca902df6b0c080aeafe2b3abf5b539c5e622020601f838e" ], [ [ "file", - "server/src/_types/taggedEntities.ts" + "../out/sdk/wasp/client/operations/queries/index.ts" ], - "783703d6c7174bc262778598da7e24b1c9727e4fd1826f5d9a947ab701fe0977" + "9d188907e5a3175e1bdada1c242ee4741eb866598d06d9d71d73a01e7a9a8ba2" ], [ [ "file", - "server/src/actions/types.ts" + "../out/sdk/wasp/client/operations/queryClient.ts" ], - "a994ed1f89011c04014deb57a2c26d09c216491caac9269380a7c14d1718b313" + "5c1d87ac10513788bcde7ebc7c10601b9ad0854cddff355e8fb7e2d4685ecdef" ], [ [ "file", - "server/src/app.js" + "../out/sdk/wasp/client/router/Link.tsx" + ], + "80db39a38f50833f8c965bfd7758da990083db60a6f2f8e394353eed5f981cc9" + ], + [ + [ + "file", + "../out/sdk/wasp/client/router/index.ts" + ], + "6fe430c2956c25c3833d6893c695523a7b2a5f1cb9eceb0bed26429c2e33e6a0" + ], + [ + [ + "file", + "../out/sdk/wasp/client/router/linkHelpers.ts" + ], + "62e48c724070c59a95c837288112922326e1351ee1defa4759bdc47f7361ce9e" + ], + [ + [ + "file", + "../out/sdk/wasp/client/router/types.ts" ], - "86504ede1daeca35cc93f665ca8ac2fdf46ecaff02f6d3a7810a14d2bc71e16a" + "d6feb23110d8cae5c94badd5cdec320207e1a5406cb827eb684aa4cffc3d7050" ], [ [ "file", - "server/src/config.js" + "../out/sdk/wasp/client/test/index.ts" ], - "d135535e045e5f5852e0b6d8bd49360e7231021cd38b540f419f5f44c6158dc2" + "cb2e2dc33df8afc0d4453f4322a4e2af92f3345e9622e0416fa87e34d6acb9d8" ], [ [ "file", - "server/src/core/AuthError.js" + "../out/sdk/wasp/client/test/vitest/helpers.tsx" ], - "5ac18ed20c5c8b192a75d1cb2f36906d5ff9f0951451a2ef08d9ab62fc26b8bb" + "e0fbaf237a21b52ff47897fb1f1b1bffb0085670b71ba7d0b1d90547ab5a8f3b" ], [ [ "file", - "server/src/core/HttpError.js" + "../out/sdk/wasp/core/config.ts" ], - "fa06ff60ab8183e8d00c13805692fc8cd3b5a21408edce4f0949d5b913e066b1" + "12a7dffb1c3fe762cec8d9d928af353cb169ff199d3934b1f3c27ce0e3a2f987" ], [ [ "file", - "server/src/dbClient.ts" + "../out/sdk/wasp/core/storage.ts" ], - "f26bfa4a60022d45195f3179548c4b09305f6a9cfe301b5edd1615677a59ae3f" + "e9e2a4a02d48bea1597fcdc00592e3d975eea7fa6e0545cf087da9429c5f4979" ], [ [ "file", - "server/src/dbSeed/types.ts" + "../out/sdk/wasp/dev/index.ts" ], - "47442c546d286164c2cdb3359deb45b47f115df2ca72bb181b4639bee2059d38" + "1c15a2858ffe39f3ef83e53705cb25b00f09e895c04cf1a354210b5babdde895" ], [ [ "file", - "server/src/entities/index.ts" + "../out/sdk/wasp/entities/index.ts" ], "c59b97b122b977b5171686c92ee5ff2d80d397c2e83cc0915affb6ee136406fb" ], [ [ "file", - "server/src/ext-src/jobs/bar.js" + "../out/sdk/wasp/ext-src/Main.css" + ], + "1583ce49887ea575e563dab0c7ad6d2e2e3e6a351ed7c2f80c310641b1456417" + ], + [ + [ + "file", + "../out/sdk/wasp/ext-src/MainPage.jsx" + ], + "4aead352bd5bbb5134b5e1f0927cf94966d80aa9dbbbb1f616e79fec8ae594e4" + ], + [ + [ + "file", + "../out/sdk/wasp/ext-src/server/jobs/bar.js" ], "2e126f35b3a3e9a289e0dcfd8707fe903c6a053e0cf85899fb5f686d77dd3eb5" ], [ [ "file", - "server/src/jobs/MySpecialJob.ts" + "../out/sdk/wasp/ext-src/vite-env.d.ts" ], - "f75ff9a6f207fdb8adc94843d78ef0f7504588f8bdb686347692ece3284d9aa8" + "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5" ], [ [ "file", - "server/src/jobs/core/allJobs.ts" + "../out/sdk/wasp/ext-src/waspLogo.png" ], - "b5ddc268dfe8f1f7d96d775c1d8d407a647a45ed4937a87da7eb1eb50f9a4674" + "0f05a89eb945d6d7326110e88776e402833b356202b06d0a8bf652e118d3fd2f" ], [ [ "file", - "server/src/jobs/core/job.ts" + "../out/sdk/wasp/package.json" + ], + "2088c007790071632d6fffacfe8fa531adc674ffbfcd8f9da8627318dff6707c" + ], + [ + [ + "file", + "../out/sdk/wasp/server/HttpError.ts" + ], + "eaa296c30acc65c78b90ebdf9a1d6fdb863f0c26c743d352afaeaa3bbc2fdd1b" + ], + [ + [ + "file", + "../out/sdk/wasp/server/_types/index.ts" + ], + "2eb94c60f2031ae3ea023de5aa938b3aeabba31388a7f8bdcdee432bbef3f517" + ], + [ + [ + "file", + "../out/sdk/wasp/server/_types/serialization.ts" + ], + "cfa5bcdd91e36fe35a91323bd3944a52873144101a5a03ae8a4f258cdd61ea03" + ], + [ + [ + "file", + "../out/sdk/wasp/server/_types/taggedEntities.ts" + ], + "94a8c58d122296edd8803618b878c66dc1ce27035735f31bb97d6a58be219324" + ], + [ + [ + "file", + "../out/sdk/wasp/server/config.ts" + ], + "4976e545d8fcf019508e95f472305e9ef27dfb3423c71e428a5414e35cdd52be" + ], + [ + [ + "file", + "../out/sdk/wasp/server/dbClient.ts" + ], + "50f11eb232174184be5fd44e8ee3875c30707b486c8c70c3f7bfb93609d38e66" + ], + [ + [ + "file", + "../out/sdk/wasp/server/index.ts" + ], + "51c3e0802764f72b88f6daaf148dba514ae817e233a40cc9b92ec91784f71f98" + ], + [ + [ + "file", + "../out/sdk/wasp/server/jobs/core/job.ts" ], "c10df70eb886d6cd132b8a0b4f619dc500bbd4ec3174ef156cdad41be8cce021" ], [ [ "file", - "server/src/jobs/core/pgBoss/pgBoss.ts" + "../out/sdk/wasp/server/jobs/core/pgBoss/index.ts" ], - "4ca3ab19aa84a0ac4f62f6d9b3ee2304fd41ab6649320473d975ae438e3c3cfd" + "ba33f9b0680dd2a6fdea55c2eb8f8163ad60f4ebbac8b459d5c1a2a708524bec" ], [ [ "file", - "server/src/jobs/core/pgBoss/pgBossJob.ts" + "../out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts" ], - "700b83862734d7ee752f685381de30fa730580fb950fbc61d168f51d1fe44bb4" + "4c405b3cf98a4cea0ee906a46e4676ebe7ce08c1652c1b502403a93ebbbf943a" ], [ [ "file", - "server/src/middleware/globalMiddleware.ts" + "../out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts" ], - "5ecfd79481386c7ba17747a6d786166c8a7f95e331462d15303e1abf7cd031b7" + "5f38460e959430e59c2e8fb8fd0f57493ea420e316258277bf67e4ba30e16cd8" ], [ [ "file", - "server/src/middleware/index.ts" + "../out/sdk/wasp/server/jobs/core/pgBoss/types.ts" ], - "e658719309f9375f389c5d8d416fc27f9c247049e61188b3e01df954bcec15a4" + "302dc48a5f4a5eb264764134c9397d27a681d1ea003fb8ca24d281c40bc0e0dc" ], [ [ "file", - "server/src/middleware/operations.ts" + "../out/sdk/wasp/server/jobs/index.ts" ], - "864c7492c27f6da1e67645fbc358dc803a168852bfd24f2c4dd13fccf6917b07" + "f044a976b9e09e5b070d7d09649e72eb5955171d7061507dabac53504f8dd8af" ], [ [ "file", - "server/src/polyfill.ts" + "../out/sdk/wasp/server/jobs/mySpecialJob.ts" ], - "66d3dca514bdd01be402714d0dfe3836e76f612346dea57ee595ae4f3da915cf" + "e3ae9eef941de7e55ccee6ea13239cb727ddf82bfa96bc41b71954e8fe1d813e" ], [ [ "file", - "server/src/queries/types.ts" + "../out/sdk/wasp/server/middleware/globalMiddleware.ts" ], - "276f022c04936bfe75d593fe8426a0aaf43a0e9c085042ad1b6560ad23041031" + "53f258be83ca6de653b6b645253ce573e3c177e88017eb2adb17f5d3cebb36c3" ], [ [ "file", - "server/src/routes/index.js" + "../out/sdk/wasp/server/middleware/index.ts" ], - "c34f77a96150414957386f5645c9becb12725c9f231aaaa8db798e3564bd75ce" + "e658719309f9375f389c5d8d416fc27f9c247049e61188b3e01df954bcec15a4" ], [ [ "file", - "server/src/routes/operations/index.js" + "../out/sdk/wasp/server/operations/actions/index.ts" ], - "d09f7dcf78ed2da15f488afb08e62d9dac15f173fdbe779323dfdd75330f5de5" + "c67a0c7d8946f5c465edea2de78e78537384bd6f30ec4f4fd6dfe58243f4f36a" ], [ [ "file", - "server/src/server.ts" + "../out/sdk/wasp/server/operations/actions/types.ts" ], - "d26cf3913b82c3525fe2214e0d94606e36ccb306ca9b036979e003f1e1d44f4b" + "cc03111599e32695d677e8ac4e65b98cf90e0cb066e71c3da06af254c784b489" ], [ [ "file", - "server/src/types/index.ts" + "../out/sdk/wasp/server/operations/index.ts" ], - "f7621082fc7d8467a0967eb0bd82ff7956052b766e9e82d50584b8de88e0d28a" + "b185af725a91995c8eb76d1c3560a488e9caef664d0add8620e2ea387e2be7f8" ], [ [ "file", - "server/src/universal/types.ts" + "../out/sdk/wasp/server/operations/queries/index.ts" ], - "8ef378c1447289104856ec1a92931fd1280c0f8d0a8463008674e93bd798b884" + "c67a0c7d8946f5c465edea2de78e78537384bd6f30ec4f4fd6dfe58243f4f36a" ], [ [ "file", - "server/src/universal/url.ts" + "../out/sdk/wasp/server/operations/queries/types.ts" ], - "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" + "19f72a3a37efd1e29b0793caa7f379494ad236bb513c8c8804b5a8d305c45196" ], [ [ "file", - "server/src/utils.ts" + "../out/sdk/wasp/server/types/index.ts" ], - "6a664e44a89efe8ed8cb7559a84bd2871422c38287b276fee2a7aed4680e1d1e" + "0f2ffdfdd76c92084bd0ba270b674628ec907da0d047de6c8a9912e415462d97" ], [ [ "file", - "server/tsconfig.json" + "../out/sdk/wasp/server/utils.ts" ], - "51a60d6350537a9e0696674aae86b122a7dea2a4497d294fd4fd6bc47b7e9808" + "a4178a3e2527d47d141340b99abf675125859fa9cb5a0535e3efa7b34a3bcabb" ], [ [ "file", - "web-app/.env" + "../out/sdk/wasp/tsconfig.json" ], - "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + "5a1d45e247132b9afbfabb9073749a924a86bfefe945a954c1f44ec672e1fef3" ], [ [ "file", - "web-app/.gitignore" + "../out/sdk/wasp/universal/types.ts" ], - "d373417ea2a8844e3b7a1515aab123e90fbeb4b7225144d55d243d9f6f04f73a" + "8ef378c1447289104856ec1a92931fd1280c0f8d0a8463008674e93bd798b884" ], [ [ "file", - "web-app/.npmrc" + "../out/sdk/wasp/universal/url.ts" ], - "7151cf397def0c2cb0ab65643701d27d335a72c90f775675b5f826bc7005818a" + "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" ], [ [ "file", - "web-app/README.md" + "../out/sdk/wasp/universal/validators.ts" ], - "6af47b8c26fa9d30e9b774e6c38d3456a3b469c3101bffb186e2a1fb325a93f4" + "80c624ff5caa11fcaa66c74eb3a473dbedc9bbac3ece740361d7752f5f45d38f" ], [ [ "file", - "web-app/index.html" + "../out/sdk/wasp/vite-env.d.ts" ], - "22a3affb86f8ca588469315523df9116dc9afb0265e2df8d861f2066c960a333" + "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5" ], [ [ "file", - "web-app/netlify.toml" + ".dockerignore" ], - "854009c7d1b2630a55099439f89e4947188ea4160c9d1388b46b5a5cf6ab461a" + "a2a5ebe3785244437c0d490b4bfa1652c84b9ab0d4f25566fd7e69d1421d7a1b" ], [ [ "file", - "web-app/package.json" + "Dockerfile" ], - "b6441767cacdd06e55f49ca98b4508ba67607e767dda33183a434ef422bff023" + "ab6bdf75fb4a56816d65231773dcce1f7133b18da6803f2b035f35bf124ea1c0" ], [ [ "file", - "web-app/public/favicon.ico" + "db/schema.prisma" ], - "1481f03584b46b63182c1f8d26e61a95ce4d8fae032b2b4f3fe5e00ab7e96c23" + "da3893a91e81d48dc133c12616d1769a556b29610736b327fd4ef179040c07ab" ], [ [ "file", - "web-app/public/manifest.json" + "server/.env" ], - "f223cbdd7db93d51c3ecf8282a06801449b29bfb6821313c383c1b18ad8c1479" + "b267ea48e5ff257c153b4f84102104eec7af8a46827aae6e76fc42c83934cfc0" ], [ [ "file", - "web-app/scripts/universal/validators.mjs" + "server/.gitignore" ], - "94edf3906c43fb476b22244d07a5d69fd6c967de767532ed5b3215e2a6eee91b" + "2c3d81dd719ff91d51609a02d03ba62ad456e2c50763b7b4c761395cb583f890" ], [ [ "file", - "web-app/scripts/validate-env.mjs" + "server/.npmrc" ], - "690460410bc9b28a8e96c6e20902e841f07b77faccf3db7e7249f48f700f4bab" + "8a74b1091affea3c71c2cf04acbaa38c4a51a261a9a98dcc9e96473d07a85a27" ], [ [ "file", - "web-app/src/actions/core.d.ts" + "server/README.md" ], - "34b44699906b98ca28050479b66254e64073a403b571a8fd1a227395d27becae" + "e14514b8b152dd2160a217d8fc66a710c8607c4ed1441a2148a0770701818249" ], [ [ "file", - "web-app/src/actions/core.js" + "server/nodemon.json" ], - "f38003d51d9754952bf595a25fdb44580d88af3bcd6658848cf8a339a8240689" + "6cb3f8539e5cf59e29e3c97c9b4fa405600ea132784e4f47f79555951f47bd38" ], [ [ "file", - "web-app/src/actions/index.ts" + "server/package.json" ], - "607c3311861456ae47c246a950c8e29593f9837a9f5c48923d99cd7fac1ce0bb" + "40898402c8a6ca25f91c17f884e7401bd7e53710da91a8399f2e2c722c273c3b" ], [ [ "file", - "web-app/src/api.ts" + "server/rollup.config.js" ], - "850331885230117aa56317186c6d38f696fb1fbd0c56470ff7c6e4f3c1c43104" + "c1beb8264f11898364288d73b16f08d1923bac5f70038d9827978deb5b58a2da" ], [ [ "file", - "web-app/src/api/events.ts" + "server/scripts/validate-env.mjs" ], - "91ec1889f649b608ca81cab8f048538b9dcc70f49444430b1e5b572af2a4970a" + "65168a764fc6cbe785ee40a8e8533b4694ef9019fc5a73f60f7252152330d0a2" ], [ [ "file", - "web-app/src/config.js" + "server/src/actions/types.ts" ], - "b06175129dd8be8ca6c307fafa02646d47233c4e26fdfeea6d7802d02e9513f3" + "cc03111599e32695d677e8ac4e65b98cf90e0cb066e71c3da06af254c784b489" ], [ [ "file", - "web-app/src/entities/index.ts" + "server/src/app.js" ], - "52d61b8ed11976d75b351d2b7227469697781fbf8996b5b98143e220ada383f9" + "a10bb6f3daab886b0685994368711fd7718a2a3e50a9329cd7da6394b9c59302" ], [ [ "file", - "web-app/src/ext-src/Main.css" + "server/src/jobs/core/allJobs.ts" ], - "1583ce49887ea575e563dab0c7ad6d2e2e3e6a351ed7c2f80c310641b1456417" + "777c5e9c0c5026689df46e542fbf325b76774db020f962c33f2c8c9168f2c776" ], [ [ "file", - "web-app/src/ext-src/MainPage.jsx" + "server/src/jobs/mySpecialJob.ts" ], - "8ee7fe1352719facadf0935eb45df8661ba13015277ea80be5a9200c66a31bde" + "a93521d6cb34ea3e5b22fea6b8adaf2e00919f2f9460f189ef3b046a87f8c4b0" ], [ [ "file", - "web-app/src/ext-src/vite-env.d.ts" + "server/src/middleware/globalMiddleware.ts" ], - "d677883c270ee71acc9bfd95c824650b541036599427a8ffc0ad33323d08e61d" + "312850493f4b17b42d5878b1c41be7db66e11bf5cf1997f9506cb06ee05ab5bd" ], [ [ "file", - "web-app/src/ext-src/vite.config.ts" + "server/src/middleware/index.ts" ], - "797dfb8022557b5ce5ce856daca01911974497f9ccf656f5920e5b42a986f4f8" + "e658719309f9375f389c5d8d416fc27f9c247049e61188b3e01df954bcec15a4" ], [ [ "file", - "web-app/src/ext-src/waspLogo.png" + "server/src/middleware/operations.ts" ], - "0f05a89eb945d6d7326110e88776e402833b356202b06d0a8bf652e118d3fd2f" + "23efbb9c408f8c12bdb77359a48177430b7da636163562d0105560891ac225b9" ], [ [ "file", - "web-app/src/index.tsx" + "server/src/polyfill.ts" ], - "d10c443130afd9848fcfa631424590784e70dc1c66a8b7a9a8c1dfa9dd7ad5df" + "66d3dca514bdd01be402714d0dfe3836e76f612346dea57ee595ae4f3da915cf" ], [ [ "file", - "web-app/src/logo.png" + "server/src/queries/types.ts" ], - "35f14abf46cb0e9d9b4e3d11961917eecb86be65a0d7f4e6bc9713c5766b5f1b" + "19f72a3a37efd1e29b0793caa7f379494ad236bb513c8c8804b5a8d305c45196" ], [ [ "file", - "web-app/src/operations/index.ts" + "server/src/routes/index.js" ], - "7ec3870a9313ec17d2282f9002da4a5d4da3c096c5fb0927acd008f1bec60bb3" + "c34f77a96150414957386f5645c9becb12725c9f231aaaa8db798e3564bd75ce" ], [ [ "file", - "web-app/src/operations/resources.js" + "server/src/routes/operations/index.js" ], - "c08445d84f9931ebc3e4f975017bf88c03b6bee9aa588e945d52fe3aee9c4d70" + "d09f7dcf78ed2da15f488afb08e62d9dac15f173fdbe779323dfdd75330f5de5" ], [ [ "file", - "web-app/src/operations/updateHandlersMap.js" + "server/src/server.ts" ], - "07a9933a771853585fd2fc49c3dcb9f1cad947acb2168580c835fae25620fa9f" + "0f09b3693004f2c6c9eea348b9e4ce2d8e0cfe2b619a2ae4d895ca252faae88a" ], [ [ "file", - "web-app/src/queries/core.d.ts" + "server/tsconfig.json" ], - "8ac475ed46a373ddc47e37dd557315c9c15abcde527749bb40c08527130e0567" + "ae9b0031fd08188a5fa7ab0a0994dfe9bdbd1d8f2e1ba2df4f609b9b470eb6b4" ], [ [ "file", - "web-app/src/queries/core.js" + "web-app/.env" ], - "3ac4a8402a7d6af3eb4a90ec59bcfdd32585f3f2dc6d6bed8a1140cea8fdb7f2" + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ], [ [ "file", - "web-app/src/queries/index.d.ts" + "web-app/.gitignore" ], - "f3a7cf037867cd7f8ce76cbca5e5eb2aacb9ca69933c182bce2f7ff935c4d385" + "d373417ea2a8844e3b7a1515aab123e90fbeb4b7225144d55d243d9f6f04f73a" ], [ [ "file", - "web-app/src/queries/index.js" + "web-app/.npmrc" ], - "8379699fa710f43d5be2b96f3a5c7c551a8d3d9db3ef0fea964502da00f36ffc" + "7151cf397def0c2cb0ab65643701d27d335a72c90f775675b5f826bc7005818a" ], [ [ "file", - "web-app/src/queryClient.js" + "web-app/README.md" ], - "1739d8618286b4a2aa536bd3fcb754514c828ec896b69c7074e22f66c07e7b03" + "6af47b8c26fa9d30e9b774e6c38d3456a3b469c3101bffb186e2a1fb325a93f4" ], [ [ "file", - "web-app/src/router.tsx" + "web-app/index.html" ], - "067478c4990bbe966fa1984cd9db91aba9aaa68196c5858eab787eb376ab48b9" + "22a3affb86f8ca588469315523df9116dc9afb0265e2df8d861f2066c960a333" ], [ [ "file", - "web-app/src/router/Link.tsx" + "web-app/netlify.toml" ], - "7b6214295d59d8dffbd61b82f9dab2b080b2d7ebe98cc7d9f9e8c229f99a890d" + "854009c7d1b2630a55099439f89e4947188ea4160c9d1388b46b5a5cf6ab461a" ], [ [ "file", - "web-app/src/router/linkHelpers.ts" + "web-app/package.json" ], - "c296ed5e7924ad1173f4f0fb4dcce053cffd5812612069b5f62d1bf9e96495cf" + "018f64a891479362d528211d2e52a038fa8948d392dd61fb9532712202d2340b" ], [ [ "file", - "web-app/src/router/types.ts" + "web-app/public/.gitkeep" ], - "7f08b262987c17f953c4b95814631a7aaac82eb77660bcb247ef7bf866846fe1" + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ], [ [ "file", - "web-app/src/storage.ts" + "web-app/public/favicon.ico" ], - "e9e2a4a02d48bea1597fcdc00592e3d975eea7fa6e0545cf087da9429c5f4979" + "1481f03584b46b63182c1f8d26e61a95ce4d8fae032b2b4f3fe5e00ab7e96c23" ], [ [ "file", - "web-app/src/test/index.ts" + "web-app/public/manifest.json" ], - "cb2e2dc33df8afc0d4453f4322a4e2af92f3345e9622e0416fa87e34d6acb9d8" + "f223cbdd7db93d51c3ecf8282a06801449b29bfb6821313c383c1b18ad8c1479" ], [ [ "file", - "web-app/src/test/vitest/helpers.tsx" + "web-app/scripts/validate-env.mjs" ], - "a38e55c9999a87ab497538bcad7c880f32a4d27f2227ae326cb76eb0848b89e9" + "a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd" ], [ [ "file", - "web-app/src/test/vitest/setup.ts" + "web-app/src/entities/index.ts" ], - "1c08b10e428cec3939e0ab269c9a02694e196de7c5dd9f18372424bdccbc5028" + "52d61b8ed11976d75b351d2b7227469697781fbf8996b5b98143e220ada383f9" ], [ [ "file", - "web-app/src/types.ts" + "web-app/src/index.tsx" ], - "282f6bdef1e7e8846ad53909bbf88c54cd04a0594b77b1e87cb69266de84cc6d" + "ff83778b7f03a8f15116bc73adce607c2c13fc9cbd4228626980a530541aaeb2" ], [ [ "file", - "web-app/src/universal/types.ts" + "web-app/src/logo.png" ], - "8ef378c1447289104856ec1a92931fd1280c0f8d0a8463008674e93bd798b884" + "35f14abf46cb0e9d9b4e3d11961917eecb86be65a0d7f4e6bc9713c5766b5f1b" ], [ [ "file", - "web-app/src/universal/url.ts" + "web-app/src/queryClient.js" ], - "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" + "1739d8618286b4a2aa536bd3fcb754514c828ec896b69c7074e22f66c07e7b03" + ], + [ + [ + "file", + "web-app/src/router.tsx" + ], + "aaa46223db86cf8a7af9c2fe89d50345e0d9b3fa2587e91f4680810d032db452" + ], + [ + [ + "file", + "web-app/src/test/vitest/setup.ts" + ], + "610e936776aaa39e861f0b2a83b0c0290d74ca8123d9d5409e5f2183384fdb52" ], [ [ @@ -613,7 +718,7 @@ "file", "web-app/tsconfig.json" ], - "f1b31ca75b2b32c5b0441aec4fcd7f285c18346761ba1640761d6253d65e3580" + "dfeee6d883ed2504c149c64b24ca939c0ad4812b78bfdced7293a386a008effd" ], [ [ @@ -627,6 +732,6 @@ "file", "web-app/vite.config.ts" ], - "08962d79f2d71eb470ee85dee03db6deca7ede28df9d41542bbaea752db0eeed" + "64256d93d81f6192f419e836ed4484f0e8c1e28f018bfb3213851608200594ac" ] ] \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/Dockerfile b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/Dockerfile index 57a8aea124..ffc14b90bf 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/Dockerfile +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/Dockerfile @@ -2,7 +2,7 @@ # Because if not, we had situations where it would use the different version # locally and on Github CI. This way we ensure exact version is used, # and also have control over updating it (instead of update surprising us). -FROM node:18-alpine3.17 AS node +FROM node:18.18.0-alpine3.17 AS node # We split Dockerfile into base, server-builder and server-production. @@ -17,14 +17,27 @@ FROM node AS base RUN apk --no-cache -U upgrade # To ensure any potential security patches are applied. +# Todo: The 'server-builder' image stays on disk under : and is +# relatively large (~900 MB), should we remove it? Or is it useful for future +# builds? FROM base AS server-builder -RUN apk add --no-cache build-base libtool autoconf automake +# Building the Docker image on Apple's Silicon Mac fails without python3 (the build +# throws `node-gyp` errors when it tries to compile native deps. Installing +# `python3` fixes the issue. +RUN apk add --no-cache python3 build-base libtool autoconf automake WORKDIR /app -COPY server/ ./server/ +# Since the framwork code in /.wasp/build/server imports the user code in /src +# using relative imports, we must mirror the same directory structure in the +# Docker image. +COPY src ./src +COPY package.json . +COPY package-lock.json . +COPY .wasp/build/server .wasp/build/server +COPY .wasp/out/sdk .wasp/out/sdk # Install npm packages, resulting in node_modules/. -RUN cd server && npm install +RUN npm install && cd .wasp/build/server && npm install # Building the server should come after Prisma generation. -RUN cd server && npm run build +RUN cd .wasp/build/server && npm run bundle # TODO: Use pm2? @@ -34,13 +47,21 @@ FROM base AS server-production RUN apk add --no-cache python3 ENV NODE_ENV production WORKDIR /app -COPY --from=server-builder /app/server/node_modules ./server/node_modules -COPY --from=server-builder /app/server/dist ./server/dist -COPY --from=server-builder /app/server/package*.json ./server/ -COPY --from=server-builder /app/server/scripts ./server/scripts -COPY db/ ./db/ +# Copying the top level 'node_modules' because it contains the Prisma packages +# necessary for migrating the database. +COPY --from=server-builder /app/node_modules ./node_modules +# Copying the SDK because 'validate-env.mjs' executes independent of the bundle +# and references the 'wasp' package. +COPY --from=server-builder /app/.wasp/out/sdk .wasp/out/sdk +# Copying 'server/node_modules' because 'validate-env.mjs' executes independent +# of the bundle and references the dotenv package. +COPY --from=server-builder /app/.wasp/build/server/node_modules .wasp/build/server/node_modules +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/ EXPOSE ${PORT} -WORKDIR /app/server +WORKDIR /app/.wasp/build/server ENTRYPOINT ["npm", "run", "start-production"] diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/db/schema.prisma b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/db/schema.prisma index 7430793da5..2725a6a54e 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/db/schema.prisma +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/db/schema.prisma @@ -6,6 +6,5 @@ datasource db { generator client { provider = "prisma-client-js" - output = env("PRISMA_CLIENT_OUTPUT_DIR") } diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/installedFullStackNpmDependencies.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/installedFullStackNpmDependencies.json deleted file mode 100644 index 14282f13f1..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/installedFullStackNpmDependencies.json +++ /dev/null @@ -1 +0,0 @@ -{"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"express","version":"~4.18.1"},{"name":"morgan","version":"~1.10.0"},{"name":"@prisma/client","version":"4.16.2"},{"name":"jsonwebtoken","version":"^8.5.1"},{"name":"secure-password","version":"^4.0.0"},{"name":"dotenv","version":"16.0.2"},{"name":"helmet","version":"^6.0.0"},{"name":"patch-package","version":"^6.4.7"},{"name":"uuid","version":"^9.0.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"},{"name":"pg-boss","version":"^8.4.2"}],"devDependencies":[{"name":"nodemon","version":"^2.0.19"},{"name":"standard","version":"^17.0.0"},{"name":"prisma","version":"4.16.2"},{"name":"typescript","version":"^5.1.0"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/uuid","version":"^9.0.0"},{"name":"@types/cors","version":"^2.8.5"}]},"npmDepsForWebApp":{"dependencies":[{"name":"axios","version":"^1.4.0"},{"name":"react","version":"^18.2.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"@prisma/client","version":"4.16.2"},{"name":"superjson","version":"^1.12.2"},{"name":"mitt","version":"3.0.0"},{"name":"react-hook-form","version":"^7.45.4"}],"devDependencies":[{"name":"vite","version":"^4.3.9"},{"name":"typescript","version":"^5.1.0"},{"name":"@types/react","version":"^18.0.37"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react-swc","version":"^3.0.0"},{"name":"dotenv","version":"^16.0.3"},{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"vitest","version":"^0.29.3"},{"name":"@vitest/ui","version":"^0.29.3"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.0.0"},{"name":"@testing-library/jest-dom","version":"^5.16.5"},{"name":"msw","version":"^1.1.0"}]}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/installedNpmDepsLog.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/installedNpmDepsLog.json new file mode 100644 index 0000000000..818b0e4f06 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/installedNpmDepsLog.json @@ -0,0 +1 @@ +{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"4.16.2"},{"name":"prisma","version":"4.16.2"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"jsonwebtoken","version":"^8.5.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"secure-password","version":"^4.0.0"},{"name":"sodium-native","version":"3.3.0"},{"name":"superjson","version":"^1.12.2"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"},{"name":"pg-boss","version":"^8.4.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"4.16.2"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"jsonwebtoken","version":"^8.5.1"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"secure-password","version":"^4.0.0"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/api/events.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/api/events.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/api/events.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/api/events.ts diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/api.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/api/index.ts similarity index 92% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/api.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/api/index.ts index 17e36c1248..d066bd5448 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/api.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/api/index.ts @@ -1,10 +1,11 @@ import axios, { type AxiosError } from 'axios' -import config from './config' -import { storage } from './storage' -import { apiEventsEmitter } from './api/events' +import config from 'wasp/core/config' +import { storage } from 'wasp/core/storage' +import { apiEventsEmitter } from './events.js' -const api = axios.create({ +// PUBLIC API +export const api = axios.create({ baseURL: config.apiUrl, }) @@ -12,22 +13,26 @@ 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() @@ -66,6 +71,7 @@ window.addEventListener('storage', (event) => { } }) +// 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 @@ -100,5 +106,3 @@ class WaspHttpError extends Error { this.data = data } } - -export default api diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/types.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/index.ts similarity index 89% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/types.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/index.ts index 982b766e37..1972713940 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/types.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/index.ts @@ -1,3 +1,4 @@ +// PUBLIC API // NOTE: This is enough to cover Operations and our APIs (src/Wasp/AppSpec/Api.hs). export enum HttpMethod { Get = 'GET', @@ -6,4 +7,5 @@ export enum HttpMethod { Delete = 'DELETE', } +// PUBLIC API export type Route = { method: HttpMethod; path: string } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/actions/core.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts similarity index 73% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/actions/core.d.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts index fa31f329ff..894c01f91c 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/actions/core.d.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts @@ -1,6 +1,7 @@ -import { type Action } from '.' -import type { Expand, _Awaited, _ReturnType } from '../universal/types' +import { type Action } from '../core.js' +import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types' +// PRIVATE API export function createAction( actionRoute: string, entitiesUsed: unknown[] diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/actions/core.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/actions/core.js similarity index 90% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/actions/core.js rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/actions/core.js index 440e906140..17dd6aba4d 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/actions/core.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/actions/core.js @@ -1,9 +1,10 @@ -import { callOperation, makeOperationRoute } from '../operations' +import { callOperation, makeOperationRoute } from '../internal/index.js' import { registerActionInProgress, registerActionDone, -} from '../operations/resources' +} from '../internal/resources.js' +// PRIVATE API export function createAction(relativeActionRoute, entitiesUsed) { const actionRoute = makeOperationRoute(relativeActionRoute) @@ -22,7 +23,7 @@ export function createAction(relativeActionRoute, entitiesUsed) { // 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 + // 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 diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/actions/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/actions/index.ts new file mode 100644 index 0000000000..32207e1a69 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/actions/index.ts @@ -0,0 +1 @@ +import { createAction } from './core' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/actions/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/core.ts similarity index 64% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/actions/index.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/core.ts index 7fb2de2f9e..282c4698a7 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/actions/index.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/core.ts @@ -4,48 +4,95 @@ import { useMutation, UseMutationOptions, useQueryClient, -} from '@tanstack/react-query' -import { type Query } from '../queries'; + useQuery as rqUseQuery, + UseQueryResult, +} from "@tanstack/react-query"; +export { configureQueryClient } from "./queryClient"; -export type Action = - [Input] extends [never] ? - (args?: unknown) => Promise : - (args: Input) => Promise +// 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[] -} + optimisticUpdates: OptimisticUpdateDefinition[]; +}; +// PUBLIC API /** * A documented (public) way to define optimistic updates. */ export type OptimisticUpdateDefinition = { - getQuerySpecifier: GetQuerySpecifier - updateQuery: UpdateQuery -} + 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 +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 +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/data-model/operations/actions#the-useaction-hook-and-optimistic-updates + * https://wasp-lang.dev/docs/language/features#the-useaction-hook. */ -export type QuerySpecifier = [Query, ...any[]] +export type QuerySpecifier = [Query, ...any[]]; +// PUBLIC API /** * A hook for adding extra behavior to a Wasp Action (e.g., optimistic updates). * @@ -59,12 +106,20 @@ export function useAction( ): typeof actionFn { const queryClient = useQueryClient(); - let mutationFn = actionFn - let options = {} + let mutationFn = actionFn; + let options = {}; if (actionOptions?.optimisticUpdates) { - const optimisticUpdatesDefinitions = actionOptions.optimisticUpdates.map(translateToInternalDefinition) - mutationFn = makeOptimisticUpdateMutationFn(actionFn, optimisticUpdatesDefinitions) - options = makeRqOptimisticUpdateOptions(queryClient, optimisticUpdatesDefinitions) + 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., @@ -74,25 +129,24 @@ export function useAction( // 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) + 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, + 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 +type SpecificUpdateQuery = (oldData: CachedData) => CachedData; /** * A specific, "instantiated" optimistic update definition which contains a @@ -101,64 +155,73 @@ type SpecificUpdateQuery = (oldData: CachedData) => CachedData type SpecificOptimisticUpdateDefinition = { queryKey: QueryKey; updateQuery: SpecificUpdateQuery; -} +}; type InternalAction = Action & { internal( item: Input, optimisticUpdateDefinitions: SpecificOptimisticUpdateDefinition[] - ): Promise -} + ): 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/data-model/operations/actions#the-useaction-hook-and-optimistic-updates + * 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 { getQuerySpecifier, updateQuery } = publicOptimisticUpdateDefinition; - const definitionErrors = [] - if (typeof getQuerySpecifier !== 'function') { - definitionErrors.push('`getQuerySpecifier` is not a function.') + 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 (typeof updateQuery !== "function") { + definitionErrors.push("`updateQuery` is not a function."); } if (definitionErrors.length) { - throw new TypeError(`Invalid optimistic update definition: ${definitionErrors.join(', ')}.`) + 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[] + 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) - } + (generalDefinition) => + getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item) + ); + return (actionFn as InternalAction).internal( + item, + specificOptimisticUpdateDefinitions + ); + }; } /** @@ -168,7 +231,7 @@ function makeOptimisticUpdateMutationFn( * 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 @@ -179,40 +242,49 @@ function makeOptimisticUpdateMutationFn( */ function makeRqOptimisticUpdateOptions( queryClient: QueryClient, - optimisticUpdateDefinitions: InternalOptimisticUpdateDefinition[] + optimisticUpdateDefinitions: InternalOptimisticUpdateDefinition< + ActionInput, + CachedData + >[] ): Pick { async function onMutate(item) { const specificOptimisticUpdateDefinitions = optimisticUpdateDefinitions.map( - generalDefinition => getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item) - ) + (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) - )) + 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() + const previousData = new Map(); specificOptimisticUpdateDefinitions.forEach(({ queryKey, updateQuery }) => { // Snapshot the currently cached value. - const previousDataForQuery: CachedData = queryClient.getQueryData(queryKey) + const previousDataForQuery: CachedData = + queryClient.getQueryData(queryKey); // Attempt to optimistically update the cache using the new value. try { - queryClient.setQueryData(queryKey, updateQuery) + queryClient.setQueryData(queryKey, updateQuery); } catch (e) { - console.error("The `updateQuery` function threw an exception, skipping optimistic update:") - console.error(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) - }) + previousData.set(queryKey, previousDataForQuery); + }); - return { previousData } + return { previousData }; } function onError(_err, _item, context) { @@ -222,15 +294,15 @@ function makeRqOptimisticUpdateOptions( // 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) - }) + await queryClient.cancelQueries(queryKey); + queryClient.setQueryData(queryKey, data); + }); } return { onMutate, onError, - } + }; } /** @@ -246,24 +318,29 @@ function makeRqOptimisticUpdateOptions( * provided definition and closes over the provided item. */ function getOptimisticUpdateDefinitionForSpecificItem( - optimisticUpdateDefinition: InternalOptimisticUpdateDefinition, + optimisticUpdateDefinition: InternalOptimisticUpdateDefinition< + ActionInput, + CachedData + >, item: ActionInput ): SpecificOptimisticUpdateDefinition { - const { getQueryKey, updateQuery } = optimisticUpdateDefinition + const { getQueryKey, updateQuery } = optimisticUpdateDefinition; return { queryKey: getQueryKey(item), - updateQuery: (old) => updateQuery(item, old) - } + 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/data-model/operations/actions#the-useaction-hook-and-optimistic-updates + * 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] +function getRqQueryKeyFromSpecifier( + querySpecifier: QuerySpecifier +): QueryKey { + const [queryFn, ...otherKeys] = querySpecifier; + return [...(queryFn as any).queryCacheKey, ...otherKeys]; } diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/index.ts new file mode 100644 index 0000000000..ec9ca9f689 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/web-app/src/operations/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/internal/index.ts similarity index 81% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/operations/index.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/internal/index.ts index 2d4494b050..c274b5aa76 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/operations/index.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/internal/index.ts @@ -1,12 +1,14 @@ -import api, { handleApiError } from '../api' -import { HttpMethod } from '../types' -import { +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) @@ -17,6 +19,7 @@ export async function callOperation(operationRoute: OperationRoute & { method: H } } +// PRIVATE API export function makeOperationRoute(relativeOperationRoute: string): OperationRoute { return { method: HttpMethod.Post, path: `/${relativeOperationRoute}` } } diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/operations/resources.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/internal/resources.js similarity index 97% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/operations/resources.js rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/internal/resources.js index 779cd55a5f..470ef70b82 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/operations/resources.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/internal/resources.js @@ -1,4 +1,4 @@ -import { queryClientInitialized } from '../queryClient' +import { queryClientInitialized } from '../queryClient.js' import { makeUpdateHandlersMap } from './updateHandlersMap' import { hashQueryKey } from '@tanstack/react-query' @@ -8,6 +8,8 @@ import { hashQueryKey } from '@tanstack/react-query' 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. diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/operations/updateHandlersMap.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/internal/updateHandlersMap.js similarity index 100% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/operations/updateHandlersMap.js rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/internal/updateHandlersMap.js diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/core.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts similarity index 63% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/core.d.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts index e1bdbe4783..ff8ae4a3b9 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/queries/core.d.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts @@ -1,19 +1,21 @@ -import { type Query } from '.' -import { Route } from '../types'; -import type { Expand, _Awaited, _ReturnType } from '../universal/types' +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[]; - }, + relativeQueryPath: string + queryRoute: Route + entitiesUsed: string[] + } ): void type QueryFor = Expand< diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/queries/core.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/queries/core.js similarity index 69% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/queries/core.js rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/queries/core.js index 5103db1d8b..c4b3e5f2e4 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/queries/core.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/queries/core.js @@ -1,16 +1,17 @@ -import { callOperation, makeOperationRoute } from '../operations' +import { callOperation, makeOperationRoute } from '../internal/index.js' import { addResourcesUsedByQuery, getActiveOptimisticUpdates, -} from '../operations/resources' +} 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), + (result, update) => update(result), serverResult, ) } @@ -20,7 +21,11 @@ export function createQuery(relativeQueryPath, entitiesUsed) { return query } -export function addMetadataToQuery(query, { relativeQueryPath, queryRoute, entitiesUsed }) { +// 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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/queries/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/queries/index.ts new file mode 100644 index 0000000000..17f6f8e238 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/queryClient.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/queryClient.ts new file mode 100644 index 0000000000..c2d1cb86df --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/web-app/src/router/Link.tsx b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/Link.tsx similarity index 91% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/router/Link.tsx rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/Link.tsx index df29edb857..2215ddc639 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/router/Link.tsx +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/Link.tsx @@ -1,10 +1,11 @@ import { useMemo } from 'react' import { Link as RouterLink } from 'react-router-dom' -import { type Routes } from '../router' import { interpolatePath } from './linkHelpers' +import { type Routes } from './index' type RouterLinkProps = Parameters[0] +// PUBLIC API export function Link( { to, params, search, hash, ...restOfProps }: Omit & { diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/index.ts new file mode 100644 index 0000000000..90f93b35f2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/web-app/src/router/linkHelpers.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/linkHelpers.ts similarity index 98% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/router/linkHelpers.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/linkHelpers.ts index 291d8238a3..e10cba9281 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/router/linkHelpers.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/linkHelpers.ts @@ -1,5 +1,6 @@ import type { Params, Search } from "./types"; +// PRIVATE API export function interpolatePath( path: string, params?: Params, diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/router/types.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/types.ts similarity index 91% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/router/types.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/types.ts index 0688d0bbba..ffaeb4fe01 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/router/types.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/router/types.ts @@ -1,13 +1,18 @@ +// 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 diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/test/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/test/index.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/test/index.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/test/index.ts diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/test/vitest/helpers.tsx b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/test/vitest/helpers.tsx similarity index 93% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/test/vitest/helpers.tsx rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/test/vitest/helpers.tsx index 4152191129..8ffbc9a7b4 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/test/vitest/helpers.tsx +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/test/vitest/helpers.tsx @@ -6,19 +6,20 @@ 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 '../../queries' -import config from '../../config' -import { HttpMethod, Route } from '../../types' - -export type { Route } from '../../types' +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 { @@ -39,6 +40,7 @@ export function renderInContext(ui: ReactElement): RenderResult { } } +// PUBLIC API export function mockServer(): { server: SetupServer mockQuery: MockQuery diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/config.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/core/config.ts similarity index 72% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/config.js rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/core/config.ts index c5d18dfed1..e9234e6f2a 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/config.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/core/config.ts @@ -1,4 +1,4 @@ -import { stripTrailingSlash } from "./universal/url"; +import { stripTrailingSlash } from 'wasp/universal/url' const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/storage.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/core/storage.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/storage.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/core/storage.ts diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dev/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dev/index.ts new file mode 100644 index 0000000000..e9bd93f7da --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/events.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/events.d.ts new file mode 100644 index 0000000000..c5f6b6e5da --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/events.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/events.js new file mode 100644 index 0000000000..b405507c51 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/events.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/events.js.map new file mode 100644 index 0000000000..de0637d22d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.d.ts new file mode 100644 index 0000000000..634416ecd5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.js new file mode 100644 index 0000000000..2015c488dc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.js.map new file mode 100644 index 0000000000..15be79e1ef --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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;CACvB,CAAC,CAAA;AAEF,MAAM,6BAA6B,GAAG,WAAW,CAAA;AAEjD,IAAI,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAuB,CAAA;AAE3F,oBAAoB;AACpB,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,oBAAoB,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,SAAS,CAAC,CAAA;IACrD,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;AACxC,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,YAAY;IAC1B,OAAO,oBAAoB,CAAA;AAC7B,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,cAAc;IAC5B,oBAAoB,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAA;IAC7C,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;AAC1C,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,mBAAmB;IACjC,oBAAoB,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,KAAK,EAAE,CAAA;IACf,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;AAC1C,CAAC;AAED,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;IACvC,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAChC,IAAI,SAAS,EAAE;QACb,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,SAAS,EAAE,CAAA;KACzD;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAC,CAAA;AAEF,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;;IACjD,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,MAAK,GAAG,EAAE;QAClC,cAAc,EAAE,CAAA;KACjB;IACD,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC,CAAC,CAAA;AAEF,kFAAkF;AAClF,2DAA2D;AAC3D,6EAA6E;AAC7E,0FAA0F;AAC1F,sFAAsF;AACtF,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;IAC3C,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,cAAc,CAAC,6BAA6B,CAAC,EAAE;QACvE,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE;YACpB,oBAAoB,GAAG,KAAK,CAAC,QAAQ,CAAA;YACrC,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;SACvC;aAAM;YACL,oBAAoB,GAAG,SAAS,CAAA;YAChC,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;SACzC;KACF;AACH,CAAC,CAAC,CAAA;AAEF,oBAAoB;AACpB;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAuD;;IACpF,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EAAE;QACnB,wEAAwE;QACxE,8CAA8C;QAC9C,8EAA8E;QAC9E,8BAA8B;QAC9B,yEAAyE;QACzE,iEAAiE;QACjE,iFAAiF;QACjF,MAAM,YAAY,GAAG,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,CAAA;QACzC,MAAM,kBAAkB,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAA;QAChD,MAAM,IAAI,aAAa,CAAC,kBAAkB,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,mCAAI,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;KAClG;SAAM;QACL,4CAA4C;QAC5C,MAAM,KAAK,CAAA;KACZ;AACH,CAAC;AAED,MAAM,aAAc,SAAQ,KAAK;IAK/B,YAAa,UAAkB,EAAE,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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.d.ts new file mode 100644 index 0000000000..fd6cf83b9e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.js new file mode 100644 index 0000000000..c13afdb0c7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.js.map new file mode 100644 index 0000000000..b7394b3505 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts new file mode 100644 index 0000000000..e2c6699d11 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js new file mode 100644 index 0000000000..51abcbe936 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map new file mode 100644 index 0000000000..5834336f1d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map new file mode 100644 index 0000000000..58e967cc07 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts new file mode 100644 index 0000000000..a23b24ebd6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/core.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/core.js new file mode 100644 index 0000000000..2c94cb01fd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/core.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/core.js.map new file mode 100644 index 0000000000..68ea114aa9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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,CAAC,GAAG,OAAO,CAAC,aAAa,EAAE,WAAW,CAAC;QACzC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC5B,OAAO,UAAU,iBACf,QAAQ,EACR,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,WAAW,CAAC,IAC1C,OAAO,EACV,CAAC;AACL,CAAC;AAmDD,aAAa;AACb;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CACvB,QAA+B,EAC/B,aAAoC;IAEpC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,IAAI,UAAU,GAAG,QAAQ,CAAC;IAC1B,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,iBAAiB,EAAE;QACpC,MAAM,4BAA4B,GAAG,aAAa,CAAC,iBAAiB,CAAC,GAAG,CACtE,6BAA6B,CAC9B,CAAC;QACF,UAAU,GAAG,8BAA8B,CACzC,QAAQ,EACR,4BAA4B,CAC7B,CAAC;QACF,OAAO,GAAG,6BAA6B,CACrC,WAAW,EACX,4BAA4B,CAC7B,CAAC;KACH;IAED,wEAAwE;IACxE,2EAA2E;IAC3E,wEAAwE;IACxE,4EAA4E;IAC5E,4EAA4E;IAC5E,sEAAsE;IACtE,0CAA0C;IAC1C,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAC9C,CAAC;AAiCD;;;;;;;;GAQG;AACH,SAAS,6BAA6B,CACpC,gCAA8E;IAE9E,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,GAAG,gCAAgC,CAAC;IAE5E,MAAM,gBAAgB,GAAG,EAAE,CAAC;IAC5B,IAAI,OAAO,iBAAiB,KAAK,UAAU,EAAE;QAC3C,gBAAgB,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;KACjE;IACD,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;QACrC,gBAAgB,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;KAC3D;IACD,IAAI,gBAAgB,CAAC,MAAM,EAAE;QAC3B,MAAM,IAAI,SAAS,CACjB,yCAAyC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACxE,CAAC;KACH;IAED,OAAO;QACL,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,0BAA0B,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC1E,WAAW;KACZ,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,8BAA8B,CACrC,QAA+B,EAC/B,2BAGG;IAEH,OAAO,SAAS,kCAAkC,CAAC,IAAI;QACrD,MAAM,mCAAmC,GAAG,2BAA2B,CAAC,GAAG,CACzE,CAAC,iBAAiB,EAAE,EAAE,CACpB,4CAA4C,CAAC,iBAAiB,EAAE,IAAI,CAAC,CACxE,CAAC;QACF,OAAQ,QAA0C,CAAC,QAAQ,CACzD,IAAI,EACJ,mCAAmC,CACpC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAS,6BAA6B,CACpC,WAAwB,EACxB,2BAGG;IAEH,KAAK,UAAU,QAAQ,CAAC,IAAI;QAC1B,MAAM,mCAAmC,GAAG,2BAA2B,CAAC,GAAG,CACzE,CAAC,iBAAiB,EAAE,EAAE,CACpB,4CAA4C,CAAC,iBAAiB,EAAE,IAAI,CAAC,CACxE,CAAC;QAEF,iFAAiF;QACjF,iEAAiE;QACjE,4EAA4E;QAC5E,mFAAmF;QACnF,MAAM,OAAO,CAAC,GAAG,CACf,mCAAmC,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CACvD,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,CACpC,CACF,CAAC;QAEF,4EAA4E;QAC5E,MAAM,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,mCAAmC,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE;YACxE,uCAAuC;YACvC,MAAM,oBAAoB,GACxB,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YAErC,kEAAkE;YAClE,IAAI;gBACF,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;aACjD;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,KAAK,CACX,4EAA4E,CAC7E,CAAC;gBACF,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aAClB;YAED,iEAAiE;YACjE,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,YAAY,EAAE,CAAC;IAC1B,CAAC;IAED,SAAS,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO;QACnC,+EAA+E;QAC/E,8EAA8E;QAC9E,8EAA8E;QAC9E,+EAA+E;QAC/E,YAAY;QACZ,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;YACpD,MAAM,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAC1C,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,QAAQ;QACR,OAAO;KACR,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,4CAA4C,CACnD,0BAGC,EACD,IAAiB;IAEjB,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,0BAA0B,CAAC;IAChE,OAAO;QACL,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC;QAC3B,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts new file mode 100644 index 0000000000..301165fa8e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/index.js new file mode 100644 index 0000000000..f83307c7b1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/index.js.map new file mode 100644 index 0000000000..982c957a9a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts new file mode 100644 index 0000000000..e31c8b5a4b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js new file mode 100644 index 0000000000..68bbdadf3d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map new file mode 100644 index 0000000000..a4097ef8cb --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts new file mode 100644 index 0000000000..6f51eab82e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js new file mode 100644 index 0000000000..86ab763337 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map new file mode 100644 index 0000000000..c91fecd3c7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;KAC7B;AACH,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,sBAAsB;IAC7D,sBAAsB,CAAC,OAAO,CAC5B,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CACzE,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,SAAS,EAAE,sBAAsB;IACxE,sBAAsB,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAA;IACjF,MAAM,sBAAsB,CAAC,SAAS,CAAC,CAAA;AACzC,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,QAAQ;IACjD,OAAO,cAAc,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAA;AACnD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B;IAC9C,MAAM,WAAW,GAAG,MAAM,sBAAsB,CAAA;IAChD,wEAAwE;IACxE,8EAA8E;IAC9E,eAAe;IACf,iFAAiF;IACjF,6EAA6E;IAC7E,wFAAwF;IACxF,kFAAkF;IAClF,WAAW,CAAC,YAAY,EAAE,CAAA;IAC1B,6EAA6E;IAC7E,2DAA2D;IAC3D,WAAW,CAAC,aAAa,EAAE,CAAA;AAC7B,CAAC;AAED;;;GAGG;AACH,KAAK,UAAU,sBAAsB,CAAC,SAAS;IAC7C,MAAM,WAAW,GAAG,MAAM,sBAAsB,CAAA;IAEhD,MAAM,0BAA0B,GAAG,wBAAwB,CAAC,SAAS,CAAC,CAAA;IACtE,0BAA0B,CAAC,OAAO,CAChC,aAAa,CAAC,EAAE,CAAC,WAAW,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAC9D,CAAA;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,uBAAuB,CAAC,QAAQ;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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts new file mode 100644 index 0000000000..715b6d06a1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js new file mode 100644 index 0000000000..34f590b5d2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map new file mode 100644 index 0000000000..7940fcd972 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts new file mode 100644 index 0000000000..cf16c63f44 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js new file mode 100644 index 0000000000..13b2cdcc9b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map new file mode 100644 index 0000000000..f8ad3284bd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts new file mode 100644 index 0000000000..575c502be1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts @@ -0,0 +1 @@ +export { addMetadataToQuery } from './core'; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js new file mode 100644 index 0000000000..1c28e8d0d3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map new file mode 100644 index 0000000000..5c83611fa3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts new file mode 100644 index 0000000000..40df1fa863 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js new file mode 100644 index 0000000000..9dfeab443f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map new file mode 100644 index 0000000000..82e2b19139 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts new file mode 100644 index 0000000000..fe53898b9f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/Link.jsx b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/Link.jsx new file mode 100644 index 0000000000..d38b7a9c65 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map new file mode 100644 index 0000000000..bb738bdad9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/index.d.ts new file mode 100644 index 0000000000..067b2fbd72 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/index.js new file mode 100644 index 0000000000..1a84b8d043 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/index.js.map new file mode 100644 index 0000000000..35eeff35e4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts new file mode 100644 index 0000000000..22fd81ec79 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js new file mode 100644 index 0000000000..144c9efc7c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map new file mode 100644 index 0000000000..064bcce597 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/types.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/types.d.ts new file mode 100644 index 0000000000..80d69a3452 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/types.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/types.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/router/types.js.map new file mode 100644 index 0000000000..7d60d60505 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/index.d.ts new file mode 100644 index 0000000000..b684c869ea --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/index.js new file mode 100644 index 0000000000..be0d1c7d5a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/index.js.map new file mode 100644 index 0000000000..33c10677b9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts new file mode 100644 index 0000000000..645112861a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx new file mode 100644 index 0000000000..fcc9fc0b7a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map new file mode 100644 index 0000000000..de41e60937 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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,CAAA;AAC3D,OAAO,EAAE,IAAI,EAA2C,MAAM,KAAK,CAAA;AACnE,OAAO,EAAE,WAAW,EAAoB,MAAM,UAAU,CAAA;AACxD,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAgB,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEvD,OAAO,MAAM,MAAM,kBAAkB,CAAA;AACrC,OAAO,EAAE,UAAU,EAAS,MAAM,aAAa,CAAA;AAW/C,aAAa;AACb,+CAA+C;AAC/C,sIAAsI;AACtI,MAAM,UAAU,eAAe,CAAC,EAAgB;IAC9C,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAA;IAChC,MAAM,KAA0B,MAAM,CACpC,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAClC;MAAA,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CACtB;IAAA,EAAE,mBAAmB,CAAC,CACvB,EAJK,EAAE,QAAQ,OAIf,EAJoB,MAAM,cAArB,YAAuB,CAI5B,CAAA;IACD,uCACK,MAAM,KACT,QAAQ,EAAE,CAAC,UAAwB,EAAE,EAAE,CACrC,QAAQ,CACN,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAClC;UAAA,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,EAAE,MAAM,CAC9B;QAAA,EAAE,mBAAmB,CAAC,CACvB,IACJ;AACH,CAAC;AAED,aAAa;AACb,MAAM,UAAU,UAAU;IAKxB,MAAM,MAAM,GAAgB,WAAW,EAAE,CAAA;IAEzC,SAAS,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;IAChC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,CAAC,aAAa,EAAE,CAAA;QACtB,OAAO,EAAE,CAAA;IACX,CAAC,CAAC,CAAA;IACF,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAA;IAE9B,MAAM,SAAS,GAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC/C,MAAM,KAAK,GAAI,KAAqC,CAAC,KAAK,CAAA;QAC1D,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAC1C,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC5C,CAAA;IACH,CAAC,CAAA;IAED,MAAM,OAAO,GAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC3C,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;IACvE,CAAC,CAAA;IAED,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAA;AACvC,CAAC;AAED,SAAS,SAAS,CAChB,MAAmB,EACnB,KAAY,EACZ,eAAwD;IAExD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;QACrD,MAAM,IAAI,KAAK,CACb,yCACE,KAAK,CAAC,MACR,mCAAmC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC3E,CAAA;KACF;IAED,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IAE3C,MAAM,QAAQ,GAAyD;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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/config.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/config.d.ts new file mode 100644 index 0000000000..b567b37b9a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/config.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/config.js new file mode 100644 index 0000000000..85d8f7e943 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/config.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/config.js.map new file mode 100644 index 0000000000..aa55beed81 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/storage.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/storage.d.ts new file mode 100644 index 0000000000..1beeea0400 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/storage.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/storage.js new file mode 100644 index 0000000000..e54cbb3c51 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/storage.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/core/storage.js.map new file mode 100644 index 0000000000..b7cd5db441 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/dev/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/dev/index.d.ts new file mode 100644 index 0000000000..14157874a1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/dev/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/dev/index.js new file mode 100644 index 0000000000..bd25589418 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/dev/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/dev/index.js.map new file mode 100644 index 0000000000..6874fe15b7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/entities/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/entities/index.d.ts new file mode 100644 index 0000000000..0af05cd188 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/entities/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/entities/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/entities/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/entities/index.js.map new file mode 100644 index 0000000000..28316c97d8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts new file mode 100644 index 0000000000..891990a1cc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx new file mode 100644 index 0000000000..1ecd86d313 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map new file mode 100644 index 0000000000..bc78a183b9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.d.ts new file mode 100644 index 0000000000..e4d9d9270c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.d.ts @@ -0,0 +1 @@ +export function foo(args: any): Promise; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js new file mode 100644 index 0000000000..ebfeebd280 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js @@ -0,0 +1,4 @@ +export const foo = async (args) => { + return 1; +}; +//# sourceMappingURL=bar.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js.map new file mode 100644 index 0000000000..da28bebe51 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bar.js","sourceRoot":"","sources":["../../../../ext-src/server/jobs/bar.js"],"names":[],"mappings":"AAAC,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,EAAE,IAAI,EAAE,EAAE;IAChC,OAAO,CAAC,CAAA;AACV,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts new file mode 100644 index 0000000000..56b8d88eca --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js new file mode 100644 index 0000000000..3e216e57ce --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js.map new file mode 100644 index 0000000000..34064e924c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts new file mode 100644 index 0000000000..7f50bdcfce --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/index.js new file mode 100644 index 0000000000..814a00a31f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/index.js.map new file mode 100644 index 0000000000..692d12face --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts new file mode 100644 index 0000000000..8338115ad9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/serialization.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/serialization.js new file mode 100644 index 0000000000..085463a738 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map new file mode 100644 index 0000000000..4be6f7733a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts new file mode 100644 index 0000000000..5e88022f3e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts @@ -0,0 +1 @@ +export type _Entity = never; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js new file mode 100644 index 0000000000..bf72aeef47 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map new file mode 100644 index 0000000000..d716981499 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.d.ts new file mode 100644 index 0000000000..223bb1b22c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js new file mode 100644 index 0000000000..6de1c8d25f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js.map new file mode 100644 index 0000000000..4b121ba37d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts new file mode 100644 index 0000000000..396ea08918 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/dbClient.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/dbClient.js new file mode 100644 index 0000000000..a5d8ecd5d8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/dbClient.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/dbClient.js.map new file mode 100644 index 0000000000..677fd6e5d3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.d.ts new file mode 100644 index 0000000000..dee9613a53 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.js new file mode 100644 index 0000000000..0e53e0deab --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.js.map new file mode 100644 index 0000000000..b84ac1b303 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/job.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/job.d.ts new file mode 100644 index 0000000000..aa576c3c2b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/job.d.ts @@ -0,0 +1,19 @@ +/** + * This is a definition of a job (think draft or invocable computation), not the running instance itself. + * This can be submitted one or more times to be executed by some job executor via the same instance. + * Once submitted, you get a SubmittedJob to track it later. + */ +export declare class Job { + readonly jobName: string; + readonly executorName: string | symbol; + constructor(jobName: string, executorName: string | symbol); +} +/** + * This is the result of submitting a Job to some executor. + * It can be used by callers to track things, or call executor-specific subclass functionality. + */ +export declare class SubmittedJob { + readonly job: Job; + readonly jobId: string; + constructor(job: Job, jobId: string); +} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js new file mode 100644 index 0000000000..385a5c440d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js @@ -0,0 +1,22 @@ +/** + * This is a definition of a job (think draft or invocable computation), not the running instance itself. + * This can be submitted one or more times to be executed by some job executor via the same instance. + * Once submitted, you get a SubmittedJob to track it later. + */ +export class Job { + constructor(jobName, executorName) { + this.jobName = jobName; + this.executorName = executorName; + } +} +/** + * This is the result of submitting a Job to some executor. + * It can be used by callers to track things, or call executor-specific subclass functionality. + */ +export class SubmittedJob { + constructor(job, jobId) { + this.job = job; + this.jobId = jobId; + } +} +//# sourceMappingURL=job.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js.map new file mode 100644 index 0000000000..bb056f13aa --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/job.js.map @@ -0,0 +1 @@ +{"version":3,"file":"job.js","sourceRoot":"","sources":["../../../../server/jobs/core/job.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,GAAG;IAId,YAAY,OAAe,EAAE,YAA6B;QACxD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,YAAY;IAIvB,YAAY,GAAQ,EAAE,KAAa;QACjC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.d.ts new file mode 100644 index 0000000000..602e9dccb1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.d.ts @@ -0,0 +1,3 @@ +export { type JobFn } from './types'; +export { registerJob, createJobDefinition } from './pgBossJob.js'; +export { startPgBoss } from './pgBoss.js'; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js new file mode 100644 index 0000000000..6ac758e025 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js @@ -0,0 +1,3 @@ +export { registerJob, createJobDefinition } from './pgBossJob.js'; +export { startPgBoss } from './pgBoss.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js.map new file mode 100644 index 0000000000..46c6288b5e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../server/jobs/core/pgBoss/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.d.ts new file mode 100644 index 0000000000..d924442e43 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.d.ts @@ -0,0 +1,12 @@ +import PgBoss from 'pg-boss'; +export declare const pgBossStarted: Promise; +/** + * Prepares the target PostgreSQL database and begins job monitoring. + * If the required database objects do not exist in the specified database, + * `boss.start()` will automatically create them. + * Ref: https://github.com/timgit/pg-boss/blob/master/docs/readme.md#start + * + * After making this call, we can send pg-boss jobs and they will be persisted and acted upon. + * This should only be called once during a server's lifetime. + */ +export declare function startPgBoss(): Promise; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js new file mode 100644 index 0000000000..d1feb61aed --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js @@ -0,0 +1,67 @@ +import PgBoss from 'pg-boss'; +import { config } from 'wasp/server'; +const boss = createPgBoss(); +function createPgBoss() { + let pgBossNewOptions = { + connectionString: config.databaseUrl, + }; + // Add an escape hatch for advanced configuration of pg-boss to overwrite our defaults. + if (process.env.PG_BOSS_NEW_OPTIONS) { + try { + pgBossNewOptions = JSON.parse(process.env.PG_BOSS_NEW_OPTIONS); + } + catch (_a) { + console.error('Environment variable PG_BOSS_NEW_OPTIONS was not parsable by JSON.parse()!'); + } + } + return new PgBoss(pgBossNewOptions); +} +let resolvePgBossStarted; +let rejectPgBossStarted; +// PRIVATE API +// Code that wants to access pg-boss must wait until it has been started. +export const pgBossStarted = new Promise((resolve, reject) => { + resolvePgBossStarted = resolve; + rejectPgBossStarted = reject; +}); +var PgBossStatus; +(function (PgBossStatus) { + PgBossStatus["Unstarted"] = "Unstarted"; + PgBossStatus["Starting"] = "Starting"; + PgBossStatus["Started"] = "Started"; + PgBossStatus["Error"] = "Error"; +})(PgBossStatus || (PgBossStatus = {})); +let pgBossStatus = PgBossStatus.Unstarted; +// PRIVATE API +/** + * Prepares the target PostgreSQL database and begins job monitoring. + * If the required database objects do not exist in the specified database, + * `boss.start()` will automatically create them. + * Ref: https://github.com/timgit/pg-boss/blob/master/docs/readme.md#start + * + * After making this call, we can send pg-boss jobs and they will be persisted and acted upon. + * This should only be called once during a server's lifetime. + */ +export async function startPgBoss() { + // Ensure pg-boss can only be started once during a server's lifetime. + if (pgBossStatus !== PgBossStatus.Unstarted) { + return; + } + pgBossStatus = PgBossStatus.Starting; + console.log('Starting pg-boss...'); + boss.on('error', (error) => console.error(error)); + try { + await boss.start(); + } + catch (error) { + console.error('pg-boss failed to start!'); + console.error(error); + pgBossStatus = PgBossStatus.Error; + rejectPgBossStarted(boss); + return; + } + resolvePgBossStarted(boss); + console.log('pg-boss started!'); + pgBossStatus = PgBossStatus.Started; +} +//# sourceMappingURL=pgBoss.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map new file mode 100644 index 0000000000..6db706ac2b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pgBoss.js","sourceRoot":"","sources":["../../../../../server/jobs/core/pgBoss/pgBoss.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,MAAM,IAAI,GAAG,YAAY,EAAE,CAAA;AAE3B,SAAS,YAAY;IACnB,IAAI,gBAAgB,GAAG;QACrB,gBAAgB,EAAE,MAAM,CAAC,WAAW;KACrC,CAAA;IAED,uFAAuF;IACvF,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE;QACnC,IAAI;YACF,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;SAC/D;QAAC,WAAM;YACN,OAAO,CAAC,KAAK,CACX,4EAA4E,CAC7E,CAAA;SACF;KACF;IAED,OAAO,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAA;AACrC,CAAC;AAED,IAAI,oBAA4C,CAAA;AAChD,IAAI,mBAA2C,CAAA;AAC/C,cAAc;AACd,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IACnE,oBAAoB,GAAG,OAAO,CAAA;IAC9B,mBAAmB,GAAG,MAAM,CAAA;AAC9B,CAAC,CAAC,CAAA;AAEF,IAAK,YAKJ;AALD,WAAK,YAAY;IACf,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;AACjB,CAAC,EALI,YAAY,KAAZ,YAAY,QAKhB;AAED,IAAI,YAAY,GAAiB,YAAY,CAAC,SAAS,CAAA;AAEvD,cAAc;AACd;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,sEAAsE;IACtE,IAAI,YAAY,KAAK,YAAY,CAAC,SAAS,EAAE;QAC3C,OAAM;KACP;IACD,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAA;IACpC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;IAElC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;IACjD,IAAI;QACF,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;KACnB;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAA;QACzC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACpB,YAAY,GAAG,YAAY,CAAC,KAAK,CAAA;QACjC,mBAAmB,CAAC,IAAI,CAAC,CAAA;QACzB,OAAM;KACP;IAED,oBAAoB,CAAC,IAAI,CAAC,CAAA;IAE1B,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;IAC/B,YAAY,GAAG,YAAY,CAAC,OAAO,CAAA;AACrC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts new file mode 100644 index 0000000000..daf1c7f9d0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts @@ -0,0 +1,71 @@ +import PgBoss from 'pg-boss'; +import { Job, SubmittedJob } from '../job.js'; +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization'; +import { PrismaDelegate } from 'wasp/server/_types'; +import type { JobFn } from 'wasp/server/jobs/core/pgBoss'; +export declare const PG_BOSS_EXECUTOR_NAME: unique symbol; +type JobSchedule = { + cron: Parameters[1]; + args: Parameters[2]; + options: Parameters[3]; +}; +/** + * Creates an instance of PgBossJob which contains all of the necessary + * information to submit a job to pg-boss. + */ +export declare function createJobDefinition>({ jobName, defaultJobOptions, jobSchedule, entities, }: { + jobName: Parameters[0]; + defaultJobOptions: PgBoss.Schedule['options']; + jobSchedule: JobSchedule | null; + entities: Entities; +}): PgBossJob; +/** + * Uses the info about a job in PgBossJob to register a user defined job handler with pg-boss. + * We expect this to be called once per job name. If called multiple times with the same name and different + * functions, we will override the previous calls. + */ +export declare function registerJob>({ job, jobFn }: { + job: PgBossJob; + jobFn: JobFn; +}): void; +/** + * This is an interface repesenting a job that can be submitted to pg-boss. + * It is not yet submitted until the caller invokes `submit()` on an instance. + * The caller can make as many calls to `submit()` as they wish. + */ +declare class PgBossJob> extends Job { + readonly defaultJobOptions: Parameters[2]; + readonly startAfter: number | string | Date; + readonly entities: Entities; + readonly jobSchedule: JobSchedule | null; + constructor(jobName: string, defaultJobOptions: Parameters[2], entities: Entities, jobSchedule: JobSchedule | null, startAfter?: number | string | Date); + delay(startAfter: number | string | Date): PgBossJob; + submit(jobArgs: Input, jobOptions?: Parameters[2]): Promise>; +} +/** + * A pg-boss specific SubmittedJob that adds additional pg-boss functionality. + */ +declare class PgBossSubmittedJob> extends SubmittedJob { + readonly pgBoss: { + readonly cancel: () => ReturnType; + readonly resume: () => ReturnType; + readonly details: () => Promise | null>; + }; + constructor(boss: PgBoss, job: PgBossJob, jobId: SubmittedJob['jobId']); +} +type PgBossDetails = Omit, 'state' | 'output'> & { + data: Input; +} & ({ + state: 'completed'; + output: JobOutputToMetadataOutput; +} | { + state: 'failed'; + output: object; +} | { + state: 'created' | 'retry' | 'active' | 'expired' | 'cancelled'; + output: null; +}); +type JobOutputToMetadataOutput = JobOutput extends null | undefined | void | Function ? null : JobOutput extends object ? JobOutput : { + value: JobOutput; +}; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js new file mode 100644 index 0000000000..e26ad6250d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js @@ -0,0 +1,93 @@ +import { pgBossStarted } from './pgBoss.js'; +import { Job, SubmittedJob } from '../job.js'; +export const PG_BOSS_EXECUTOR_NAME = Symbol('PgBoss'); +// PRIVATE API +/** + * Creates an instance of PgBossJob which contains all of the necessary + * information to submit a job to pg-boss. + */ +export function createJobDefinition({ jobName, defaultJobOptions, jobSchedule, entities, }) { + return new PgBossJob(jobName, defaultJobOptions, entities, jobSchedule); +} +// PRIVATE API +/** + * Uses the info about a job in PgBossJob to register a user defined job handler with pg-boss. + * We expect this to be called once per job name. If called multiple times with the same name and different + * functions, we will override the previous calls. + */ +export function registerJob({ job, jobFn }) { + // NOTE(shayne): We are not awaiting `pgBossStarted` here since we need to return an instance to the job + // template, or else the NodeJS module bootstrapping process will block and fail as it would then depend + // on a runtime resolution of the promise in `startServer()`. + // Since `pgBossStarted` will resolve in the future, it may appear possible to send pg-boss + // a job before we actually have registered the handler via `boss.work()`. However, even if NodeJS does + // not execute this callback before any job `submit()` calls, this is not a problem since pg-boss allows you + // to submit jobs even if there are no workers registered. + // Once they are registered, they will just start on the first job in their queue. + pgBossStarted.then(async (boss) => { + // As a safety precaution against undefined behavior of registering different + // functions for the same job name, remove all registered functions first. + await boss.offWork(job.jobName); + // This tells pg-boss to run given worker function when job with that name is submitted. + // Ref: https://github.com/timgit/pg-boss/blob/master/docs/readme.md#work + await boss.work(job.jobName, pgBossCallbackWrapper(jobFn, job.entities)); + // If a job schedule is provided, we should schedule the recurring job. + // If the schedule name already exists, it's updated to the provided cron expression, arguments, and options. + // Ref: https://github.com/timgit/pg-boss/blob/master/docs/readme.md#scheduling + if (job.jobSchedule) { + const options = Object.assign(Object.assign({}, job.defaultJobOptions), job.jobSchedule.options); + await boss.schedule(job.jobName, job.jobSchedule.cron, job.jobSchedule.args || null, options); + } + }); +} +/** + * This is an interface repesenting a job that can be submitted to pg-boss. + * It is not yet submitted until the caller invokes `submit()` on an instance. + * The caller can make as many calls to `submit()` as they wish. + */ +class PgBossJob extends Job { + constructor(jobName, defaultJobOptions, entities, jobSchedule, startAfter) { + super(jobName, PG_BOSS_EXECUTOR_NAME); + this.defaultJobOptions = defaultJobOptions; + this.entities = entities; + this.jobSchedule = jobSchedule; + this.startAfter = startAfter; + } + delay(startAfter) { + return new PgBossJob(this.jobName, this.defaultJobOptions, this.entities, this.jobSchedule, startAfter); + } + async submit(jobArgs, jobOptions = {}) { + const boss = await pgBossStarted; + const jobId = await boss.send(this.jobName, jobArgs, Object.assign(Object.assign(Object.assign({}, this.defaultJobOptions), (this.startAfter && { startAfter: this.startAfter })), jobOptions)); + return new PgBossSubmittedJob(boss, this, jobId); + } +} +/** + * A pg-boss specific SubmittedJob that adds additional pg-boss functionality. + */ +class PgBossSubmittedJob extends SubmittedJob { + constructor(boss, job, jobId) { + super(job, jobId); + this.pgBoss = { + cancel: () => boss.cancel(jobId), + resume: () => boss.resume(jobId), + // Coarcing here since pg-boss typings are not precise enough. + details: () => boss.getJobById(jobId), + }; + } +} +/** + * Wraps the normal pg-boss callback function to inject entities, as well as extract + * the `data` property so the arguments passed into the job are the exact same as those received. + */ +function pgBossCallbackWrapper( +// jobFn - The user-defined async job callback function. +jobFn, +// Entities used by job, passed into callback context. +entities) { + return (args) => { + const context = { entities }; + return jobFn(args.data, context); + }; +} +//# sourceMappingURL=pgBossJob.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map new file mode 100644 index 0000000000..4b8eb79a28 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pgBossJob.js","sourceRoot":"","sources":["../../../../../server/jobs/core/pgBoss/pgBossJob.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAK7C,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAQrD,cAAc;AACd;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAIjC,EACA,OAAO,EACP,iBAAiB,EACjB,WAAW,EACX,QAAQ,GAUT;IACC,OAAO,IAAI,SAAS,CAClB,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,WAAW,CACZ,CAAA;AACH,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAIzB,EAAE,GAAG,EAAE,KAAK,EAGb;IACC,wGAAwG;IACxG,wGAAwG;IACxG,6DAA6D;IAC7D,2FAA2F;IAC3F,uGAAuG;IACvG,4GAA4G;IAC5G,0DAA0D;IAC1D,kFAAkF;IAClF,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAChC,6EAA6E;QAC7E,0EAA0E;QAC1E,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAE/B,wFAAwF;QACxF,yEAAyE;QACzE,MAAM,IAAI,CAAC,IAAI,CACb,GAAG,CAAC,OAAO,EACX,qBAAqB,CAA0B,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC,CACpE,CAAA;QAED,uEAAuE;QACvE,6GAA6G;QAC7G,+EAA+E;QAC/E,IAAI,GAAG,CAAC,WAAW,EAAE;YACnB,MAAM,OAAO,mCACR,GAAG,CAAC,iBAAiB,GACrB,GAAG,CAAC,WAAW,CAAC,OAAO,CAC3B,CAAA;YACD,MAAM,IAAI,CAAC,QAAQ,CACjB,GAAG,CAAC,OAAO,EACX,GAAG,CAAC,WAAW,CAAC,IAAI,EACpB,GAAG,CAAC,WAAW,CAAC,IAAI,IAAI,IAAI,EAC5B,OAAO,CACR,CAAA;SACF;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,SAIJ,SAAQ,GAAG;IAMX,YACE,OAAe,EACf,iBAAgD,EAChD,QAAkB,EAClB,WAA+B,EAC/B,UAAmC;QAEnC,KAAK,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAA;QACrC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAA;QAC1C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;IACD,KAAK,CAAC,UAAkC;QACtC,OAAO,IAAI,SAAS,CAClB,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,iBAAiB,EACtB,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,WAAW,EAChB,UAAU,CACX,CAAA;IACH,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAAc,EAAE,aAA4C,EAAE;QACzE,MAAM,IAAI,GAAG,MAAM,aAAa,CAAA;QAChC,MAAM,KAAK,GAAG,MAAO,IAAI,CAAC,IAAY,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,gDACvD,IAAI,CAAC,iBAAiB,GACtB,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,GACpD,UAAU,EACb,CAAA;QACF,OAAO,IAAI,kBAAkB,CAA0B,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;IAC3E,CAAC;CACF;AAED;;GAEG;AACH,MAAM,kBAIJ,SAAQ,YAAY;IAOpB,YACE,IAAY,EACZ,GAAuC,EACvC,KAA4B;QAE5B,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QACjB,IAAI,CAAC,MAAM,GAAG;YACZ,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YAChC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YAChC,8DAA8D;YAC9D,OAAO,EAAE,GAAG,EAAE,CACZ,IAAI,CAAC,UAAU,CAAC,KAAK,CAAiD;SACzE,CAAA;IACH,CAAC;CACF;AAED;;;GAGG;AACH,SAAS,qBAAqB;AAK5B,wDAAwD;AACxD,KAAqC;AACrC,sDAAsD;AACtD,QAAkB;IAElB,OAAO,CAAC,IAAqB,EAAE,EAAE;QAC/B,MAAM,OAAO,GAAG,EAAE,QAAQ,EAAE,CAAA;QAC5B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAClC,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.d.ts new file mode 100644 index 0000000000..972df20e0c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.d.ts @@ -0,0 +1,5 @@ +import { PrismaDelegate } from 'wasp/server/_types'; +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization'; +export type JobFn> = (data: Input, context: { + entities: Entities; +}) => Promise; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js.map new file mode 100644 index 0000000000..3e9bb733a3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../server/jobs/core/pgBoss/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.d.ts new file mode 100644 index 0000000000..c70811600c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.d.ts @@ -0,0 +1 @@ +export { type MySpecialJob, mySpecialJob } from './mySpecialJob.js'; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js new file mode 100644 index 0000000000..c0700a06be --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js @@ -0,0 +1,2 @@ +export { mySpecialJob } from './mySpecialJob.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js.map new file mode 100644 index 0000000000..bf72d0da78 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/jobs/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,YAAY,EAAE,MAAM,mBAAmB,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts new file mode 100644 index 0000000000..4f9f5b1763 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts @@ -0,0 +1,46 @@ +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization'; +import { type JobFn } from 'wasp/server/jobs/core/pgBoss'; +declare const entities: {}; +export type MySpecialJob = JobFn; +export declare const mySpecialJob: { + readonly defaultJobOptions: import("pg-boss").SendOptions; + readonly startAfter: string | number | Date; + readonly entities: {}; + readonly jobSchedule: { + cron: string; + args: object; + options: import("pg-boss").ScheduleOptions; + }; + delay(startAfter: string | number | Date): any; + submit(jobArgs: JSONObject, jobOptions?: import("pg-boss").SendOptions): Promise<{ + readonly pgBoss: { + readonly cancel: () => Promise; + readonly resume: () => Promise; + readonly details: () => Promise, "output" | "state"> & { + data: JSONObject; + } & ({ + state: "failed"; + output: object; + } | { + state: "retry" | "created" | "active" | "expired" | "cancelled"; + output: null; + } | { + state: "completed"; + output: import("wasp/server/_types/serialization").JSONArray | JSONObject | { + value: string; + } | { + value: number; + } | { + value: false; + } | { + value: true; + }; + })>; + }; + readonly job: import("./core/job").Job; + readonly jobId: string; + }>; + readonly jobName: string; + readonly executorName: string | symbol; +}; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js new file mode 100644 index 0000000000..f8de946894 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js @@ -0,0 +1,10 @@ +import { createJobDefinition } from 'wasp/server/jobs/core/pgBoss'; +const entities = {}; +// PUBLIC API +export const mySpecialJob = createJobDefinition({ + jobName: 'mySpecialJob', + defaultJobOptions: {}, + jobSchedule: null, + entities, +}); +//# sourceMappingURL=mySpecialJob.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map new file mode 100644 index 0000000000..4ae829e30f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mySpecialJob.js","sourceRoot":"","sources":["../../../server/jobs/mySpecialJob.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAE9E,MAAM,QAAQ,GAAG,EAChB,CAAA;AAKD,aAAa;AACb,MAAM,CAAC,MAAM,YAAY,GAAG,mBAAmB,CAAC;IAC9C,OAAO,EAAE,cAAc;IACvB,iBAAiB,EAAE,EAAE;IACrB,WAAW,EAAE,IAAI;IACjB,QAAQ;CACT,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts new file mode 100644 index 0000000000..617cac8a78 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js new file mode 100644 index 0000000000..0926cba3d4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map new file mode 100644 index 0000000000..0490e6f7e3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts new file mode 100644 index 0000000000..4204eb294c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts @@ -0,0 +1 @@ +export * from './globalMiddleware.js'; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/index.js new file mode 100644 index 0000000000..db90d2875a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map new file mode 100644 index 0000000000..23374314b8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map new file mode 100644 index 0000000000..2735731598 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map new file mode 100644 index 0000000000..43367cc658 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts new file mode 100644 index 0000000000..ee6ed4259c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/index.js new file mode 100644 index 0000000000..dde0d8e4ae --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/index.js.map new file mode 100644 index 0000000000..3e4a082c05 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map new file mode 100644 index 0000000000..d36dc482c2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map new file mode 100644 index 0000000000..c4eb8778e7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/types/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/types/index.d.ts new file mode 100644 index 0000000000..ce2e8cb99c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/types/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/types/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/types/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/types/index.js.map new file mode 100644 index 0000000000..4ab1f1d596 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/utils.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/utils.d.ts new file mode 100644 index 0000000000..266b9c6fbb --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/utils.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/utils.js new file mode 100644 index 0000000000..9b2034006b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/utils.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/utils.js.map new file mode 100644 index 0000000000..f3af561141 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/types.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/types.d.ts new file mode 100644 index 0000000000..14dd465dca --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/types.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/types.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/types.js.map new file mode 100644 index 0000000000..8c06b33e94 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/url.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/url.d.ts new file mode 100644 index 0000000000..aa893e7838 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/url.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/url.js new file mode 100644 index 0000000000..988c0a67aa --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/url.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/url.js.map new file mode 100644 index 0000000000..a7bad96020 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/validators.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/validators.d.ts new file mode 100644 index 0000000000..bd179246a1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/web-app/scripts/universal/validators.mjs b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/validators.js similarity index 91% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/scripts/universal/validators.mjs rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/validators.js index 9e3605d3b5..53462b3932 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/scripts/universal/validators.mjs +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/validators.js @@ -9,13 +9,14 @@ export function isValidAbsoluteURL(rawUrl) { "localhost:" and host of "3000" */ return url.protocol === "http:" || url.protocol === "https:"; - } catch (e) { + } + 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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/validators.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/validators.js.map new file mode 100644 index 0000000000..313c98cef4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/server/src/entities/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/entities/index.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/entities/index.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/entities/index.ts diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/ext-src/Main.css b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/ext-src/Main.css similarity index 100% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/ext-src/Main.css rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/ext-src/Main.css diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/ext-src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/ext-src/MainPage.jsx new file mode 100644 index 0000000000..01aae7c3db --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/server/src/ext-src/jobs/bar.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/ext-src/server/jobs/bar.js similarity index 100% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/ext-src/jobs/bar.js rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/ext-src/server/jobs/bar.js diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/ext-src/waspLogo.png b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/ext-src/waspLogo.png similarity index 100% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/ext-src/waspLogo.png rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/ext-src/waspLogo.png diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/package.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/package.json new file mode 100644 index 0000000000..34a413e631 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/package.json @@ -0,0 +1,102 @@ +{ + "dependencies": { + "@prisma/client": "4.16.2", + "@tanstack/react-query": "^4.29.0", + "@testing-library/jest-dom": "^6.3.0", + "@testing-library/react": "^14.1.2", + "@types/express-serve-static-core": "^4.17.13", + "@vitest/ui": "^1.2.1", + "axios": "^1.4.0", + "express": "~4.18.1", + "jsdom": "^21.1.1", + "jsonwebtoken": "^8.5.1", + "lodash.merge": "^4.6.2", + "mitt": "3.0.0", + "msw": "^1.1.0", + "pg-boss": "^8.4.2", + "prisma": "4.16.2", + "react": "^18.2.0", + "react-hook-form": "^7.45.4", + "react-router-dom": "^5.3.3", + "secure-password": "^4.0.0", + "sodium-native": "3.3.0", + "superjson": "^1.12.2", + "uuid": "^9.0.0", + "vitest": "^1.2.1" + }, + "devDependencies": { + "@tsconfig/node18": "latest" + }, + "exports": { + "./api/events": "./dist/api/events.js", + "./auth": "./dist/auth/index.js", + "./auth/helpers/user": "./dist/auth/helpers/user.js", + "./auth/jwt": "./dist/auth/jwt.js", + "./auth/pages/createAuthRequiredPage": "./dist/auth/pages/createAuthRequiredPage.jsx", + "./auth/password": "./dist/auth/password.js", + "./auth/providers/types": "./dist/auth/providers/types.js", + "./auth/session": "./dist/auth/session.js", + "./auth/utils": "./dist/auth/utils.js", + "./auth/validation": "./dist/auth/validation.js", + "./client": "./dist/client/index.js", + "./client/api": "./dist/api/index.js", + "./client/auth": "./dist/client/auth/index.js", + "./client/crud": "./dist/client/crud/index.js", + "./client/operations": "./dist/client/operations/index.js", + "./client/router": "./dist/client/router/index.js", + "./client/test": "./dist/client/test/index.js", + "./client/test/*": "./dist/client/test/*.js", + "./client/webSocket": "./dist/client/webSocket/index.js", + "./client/webSocket/WebSocketProvider": "./dist/client/webSocket/WebSocketProvider.jsx", + "./core/auth": "./dist/core/auth.js", + "./core/config": "./dist/core/config.js", + "./core/stitches.config": "./dist/core/stitches.config.js", + "./core/storage": "./dist/core/storage.js", + "./dev": "./dist/dev/index.js", + "./entities": "./dist/entities/index.js", + "./ext-src/*": "./dist/ext-src/*.js", + "./operations": "./dist/operations/index.js", + "./operations/*": "./dist/operations/*", + "./server": "./dist/server/index.js", + "./server/api": "./dist/server/api/index.js", + "./server/auth": "./dist/server/auth/index.js", + "./server/auth/email": "./dist/server/auth/email/index.js", + "./server/auth/email/utils": "./dist/server/auth/email/utils.js", + "./server/crud": "./dist/server/crud/index.js", + "./server/crud/*": "./dist/server/crud/*", + "./server/email": "./dist/server/email/index.js", + "./server/email/core/types": "./dist/server/email/core/types.js", + "./server/jobs": "./dist/server/jobs/index.js", + "./server/jobs/*": "./dist/server/jobs/*.js", + "./server/jobs/core/pgBoss": "./dist/server/jobs/core/pgBoss/index.js", + "./server/middleware": "./dist/server/middleware/index.js", + "./server/opeations/actions": "./dist/server/actions/index.js", + "./server/operations": "./dist/server/operations/index.js", + "./server/operations/queries": "./dist/server/queries/index.js", + "./server/types": "./dist/server/types/index.js", + "./server/utils": "./dist/server/utils.js", + "./server/webSocket": "./dist/server/webSocket/index.js", + "./universal/types": "./dist/universal/types.js", + "./universal/url": "./dist/universal/url.js", + "./universal/validators": "./dist/universal/validators.js" + }, + "include": [ + "src/**/*" + ], + "license": "ISC", + "name": "wasp", + "private": true, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "types": "tsc --declaration --emitDeclarationOnly --stripInternal --declarationDir dist" + }, + "type": "module", + "typesVersions": { + "*": { + "client/api": [ + "api/index.ts" + ] + } + }, + "version": "1.0.0" +} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/core/HttpError.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/HttpError.ts similarity index 67% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/core/HttpError.js rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/HttpError.ts index 8a2cb04db5..3e8d3f5a0d 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/core/HttpError.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/HttpError.ts @@ -1,5 +1,8 @@ -class HttpError extends Error { - constructor (statusCode, message, data, ...params) { +export class HttpError extends Error { + public statusCode: number + public data: unknown + + constructor (statusCode: number, message?: string, data?: Record, ...params: unknown[]) { super(message, ...params) if (Error.captureStackTrace) { @@ -18,5 +21,3 @@ class HttpError extends Error { } } } - -export default HttpError diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/_types/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/_types/index.ts similarity index 93% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/_types/index.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/_types/index.ts index 189810ac8d..137aa69a91 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/_types/index.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/_types/index.ts @@ -1,7 +1,7 @@ -import { type Expand } from "../universal/types.js"; +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 "../dbClient.js" +import { prisma } from 'wasp/server' import { type _Entity } from "./taggedEntities" import { type Payload } from "./serialization"; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/_types/serialization.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/_types/serialization.ts similarity index 95% rename from waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/_types/serialization.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/_types/serialization.ts index 595b5ba69f..c8ff9c1ae3 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/_types/serialization.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/_types/serialization.ts @@ -18,7 +18,7 @@ export interface JSONObject { type PrimitiveJSONValue = string | number | boolean | undefined | null -interface JSONArray extends Array {} +export interface JSONArray extends Array {} type SerializableJSONValue = | Symbol diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/_types/taggedEntities.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts similarity index 94% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/_types/taggedEntities.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts index 6d3985f027..61c6677ae3 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/_types/taggedEntities.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts @@ -6,7 +6,7 @@ import { type Entity, type EntityName, -} from '../entities' +} from 'wasp/entities' export type _Entity = diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/config.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/config.ts similarity index 59% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/config.js rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/config.ts index 35ba136633..07c90ee26b 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/config.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/config.ts @@ -1,6 +1,6 @@ import merge from 'lodash.merge' -import { stripTrailingSlash } from "./universal/url.js"; +import { stripTrailingSlash } from "wasp/universal/url"; const env = process.env.NODE_ENV || 'development' @@ -9,23 +9,44 @@ const env = process.env.NODE_ENV || 'development' // - Use convict library to define schema and validate env vars. // https://codingsans.com/blog/node-config-best-practices -const config = { +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, - frontendUrl: undefined, allowedCORSOrigins: [], }, development: getDevelopmentConfig(), production: getProductionConfig(), } -const resolvedConfig = merge(config.all, config[env]) +const resolvedConfig: Config = merge(config.all, config[env]) +// PUBLIC API export default resolvedConfig -function getDevelopmentConfig() { +function getDevelopmentConfig(): EnvConfig { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); return { frontendUrl, @@ -33,7 +54,7 @@ function getDevelopmentConfig() { } } -function getProductionConfig() { +function getProductionConfig(): EnvConfig { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); return { frontendUrl, diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/dbClient.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/dbClient.ts new file mode 100644 index 0000000000..0084433d03 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/index.ts new file mode 100644 index 0000000000..535077900b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/server/src/jobs/core/job.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/job.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/core/job.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/job.ts diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/index.ts new file mode 100644 index 0000000000..b6789d10c6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/index.ts @@ -0,0 +1,3 @@ +export { type JobFn } from './types' +export { registerJob, createJobDefinition } from './pgBossJob.js' +export { startPgBoss } from './pgBoss.js' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/core/pgBoss/pgBoss.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts similarity index 96% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/core/pgBoss/pgBoss.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts index e7600991ed..a48992aad0 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/core/pgBoss/pgBoss.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts @@ -1,5 +1,5 @@ import PgBoss from 'pg-boss' -import config from '../../../config.js' +import { config } from 'wasp/server' const boss = createPgBoss() @@ -24,6 +24,7 @@ function createPgBoss() { let resolvePgBossStarted: (boss: PgBoss) => void let rejectPgBossStarted: (boss: PgBoss) => void +// PRIVATE API // Code that wants to access pg-boss must wait until it has been started. export const pgBossStarted = new Promise((resolve, reject) => { resolvePgBossStarted = resolve @@ -39,6 +40,7 @@ enum PgBossStatus { let pgBossStatus: PgBossStatus = PgBossStatus.Unstarted +// PRIVATE API /** * Prepares the target PostgreSQL database and begins job monitoring. * If the required database objects do not exist in the specified database, diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/core/pgBoss/pgBossJob.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts similarity index 76% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/core/pgBoss/pgBossJob.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts index 5e50f97e73..42435db213 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/jobs/core/pgBoss/pgBossJob.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts @@ -1,41 +1,63 @@ import PgBoss from 'pg-boss' import { pgBossStarted } from './pgBoss.js' import { Job, SubmittedJob } from '../job.js' -import type { JSONValue, JSONObject } from '../../../_types/serialization.js' -import { PrismaDelegate } from '../../../_types/index.js' +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization' +import { PrismaDelegate } from 'wasp/server/_types' +import type { JobFn } from 'wasp/server/jobs/core/pgBoss' export const PG_BOSS_EXECUTOR_NAME = Symbol('PgBoss') +type JobSchedule = { + cron: Parameters[1] + args: Parameters[2] + options: Parameters[3] +} + +// PRIVATE API /** - * Creates an instance of PgBossJob and initializes the PgBoss executor by registering this job function. - * We expect this to be called once per job name. If called multiple times with the same name and different - * functions, we will override the previous calls. + * Creates an instance of PgBossJob which contains all of the necessary + * information to submit a job to pg-boss. */ -export function createJob< +export function createJobDefinition< Input extends JSONObject, Output extends JSONValue | void, Entities extends Partial >({ jobName, - jobFn, defaultJobOptions, jobSchedule, entities, }: { // jobName - The user-defined job name in their .wasp file. jobName: Parameters[0] - // jobFn - The user-defined async job callback function. - jobFn: JobFn // defaultJobOptions - pg-boss specific options for `boss.send()` applied to every `submit()` invocation, // which can overriden in that call. defaultJobOptions: PgBoss.Schedule['options'] - jobSchedule?: { - cron: Parameters[1] - args: Parameters[2] - options: Parameters[3] - } + jobSchedule: JobSchedule | null // Entities used by job, passed into callback context. entities: Entities +}) { + return new PgBossJob( + jobName, + defaultJobOptions, + entities, + jobSchedule, + ) +} + +// PRIVATE API +/** + * Uses the info about a job in PgBossJob to register a user defined job handler with pg-boss. + * We expect this to be called once per job name. If called multiple times with the same name and different + * functions, we will override the previous calls. + */ +export function registerJob< + Input extends JSONObject, + Output extends JSONValue | void, + Entities extends Partial +>({ job, jobFn }: { + job: PgBossJob, + jobFn: JobFn, }) { // NOTE(shayne): We are not awaiting `pgBossStarted` here since we need to return an instance to the job // template, or else the NodeJS module bootstrapping process will block and fail as it would then depend @@ -48,41 +70,33 @@ export function createJob< pgBossStarted.then(async (boss) => { // As a safety precaution against undefined behavior of registering different // functions for the same job name, remove all registered functions first. - await boss.offWork(jobName) + await boss.offWork(job.jobName) // This tells pg-boss to run given worker function when job with that name is submitted. // Ref: https://github.com/timgit/pg-boss/blob/master/docs/readme.md#work await boss.work( - jobName, - pgBossCallbackWrapper(jobFn, entities) + job.jobName, + pgBossCallbackWrapper(jobFn, job.entities) ) // If a job schedule is provided, we should schedule the recurring job. // If the schedule name already exists, it's updated to the provided cron expression, arguments, and options. // Ref: https://github.com/timgit/pg-boss/blob/master/docs/readme.md#scheduling - if (jobSchedule) { + if (job.jobSchedule) { const options: PgBoss.ScheduleOptions = { - ...defaultJobOptions, - ...jobSchedule.options, + ...job.defaultJobOptions, + ...job.jobSchedule.options, } await boss.schedule( - jobName, - jobSchedule.cron, - jobSchedule.args || null, + job.jobName, + job.jobSchedule.cron, + job.jobSchedule.args || null, options ) } }) - - return new PgBossJob(jobName, defaultJobOptions) } -export type JobFn< - Input extends JSONObject, - Output extends JSONValue | void, - Entities extends Partial -> = (data: Input, context: { entities: Entities }) => Promise - /** * This is an interface repesenting a job that can be submitted to pg-boss. * It is not yet submitted until the caller invokes `submit()` on an instance. @@ -90,24 +104,33 @@ export type JobFn< */ class PgBossJob< Input extends JSONObject, - Output extends JSONValue | void + Output extends JSONValue | void, + Entities extends Partial > extends Job { public readonly defaultJobOptions: Parameters[2] public readonly startAfter: number | string | Date + public readonly entities: Entities + public readonly jobSchedule: JobSchedule | null constructor( jobName: string, defaultJobOptions: Parameters[2], + entities: Entities, + jobSchedule: JobSchedule | null, startAfter?: number | string | Date ) { super(jobName, PG_BOSS_EXECUTOR_NAME) this.defaultJobOptions = defaultJobOptions + this.entities = entities + this.jobSchedule = jobSchedule this.startAfter = startAfter } delay(startAfter: number | string | Date) { - return new PgBossJob( + return new PgBossJob( this.jobName, this.defaultJobOptions, + this.entities, + this.jobSchedule, startAfter ) } @@ -118,7 +141,7 @@ class PgBossJob< ...(this.startAfter && { startAfter: this.startAfter }), ...jobOptions, }) - return new PgBossSubmittedJob(boss, this, jobId) + return new PgBossSubmittedJob(boss, this, jobId) } } @@ -127,7 +150,8 @@ class PgBossJob< */ class PgBossSubmittedJob< Input extends JSONObject, - Output extends JSONValue | void + Output extends JSONValue | void, + Entities extends Partial > extends SubmittedJob { public readonly pgBoss: { readonly cancel: () => ReturnType @@ -137,7 +161,7 @@ class PgBossSubmittedJob< constructor( boss: PgBoss, - job: PgBossJob, + job: PgBossJob, jobId: SubmittedJob['jobId'] ) { super(job, jobId) diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/types.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/types.ts new file mode 100644 index 0000000000..4ebb34b61b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/types.ts @@ -0,0 +1,9 @@ +import { PrismaDelegate } from 'wasp/server/_types' +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization' + +// PRIVATE API +export type JobFn< + Input extends JSONObject, + Output extends JSONValue | void, + Entities extends Partial +> = (data: Input, context: { entities: Entities }) => Promise diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/index.ts new file mode 100644 index 0000000000..8da5c7449c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/index.ts @@ -0,0 +1,2 @@ + +export { type MySpecialJob, mySpecialJob } from './mySpecialJob.js' diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts new file mode 100644 index 0000000000..574030dba0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts @@ -0,0 +1,17 @@ +import { prisma } from 'wasp/server' +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization' +import { type JobFn, createJobDefinition } from 'wasp/server/jobs/core/pgBoss' + +const entities = { +} + +// PUBLIC API +export type MySpecialJob = JobFn + +// PUBLIC API +export const mySpecialJob = createJobDefinition({ + jobName: 'mySpecialJob', + defaultJobOptions: {}, + jobSchedule: null, + entities, +}) diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts new file mode 100644 index 0000000000..8bab5e4709 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/middleware/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/middleware/index.ts new file mode 100644 index 0000000000..50996ec27d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/middleware/index.ts @@ -0,0 +1 @@ +export * from './globalMiddleware.js' diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/operations/actions/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/operations/actions/index.ts new file mode 100644 index 0000000000..78b2ff0a44 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/operations/actions/index.ts @@ -0,0 +1,2 @@ +import { prisma } from 'wasp/server' + diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/operations/actions/types.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/operations/actions/types.ts new file mode 100644 index 0000000000..183065b864 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/operations/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/operations/index.ts new file mode 100644 index 0000000000..5d50ecb37b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/operations/queries/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/operations/queries/index.ts new file mode 100644 index 0000000000..78b2ff0a44 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/operations/queries/index.ts @@ -0,0 +1,2 @@ +import { prisma } from 'wasp/server' + diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/operations/queries/types.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/operations/queries/types.ts new file mode 100644 index 0000000000..a156fb294a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/server/src/types/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/types/index.ts similarity index 73% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/types/index.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/types/index.ts index b30c92f5ec..1bbffc7555 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/types/index.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/types/index.ts @@ -1,14 +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, } - -export type { Application } from 'express' -export type { Server } from 'http' - diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/utils.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/utils.ts similarity index 52% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/utils.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/utils.ts index 99492c5474..c8cc823348 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/utils.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/utils.ts @@ -32,33 +32,3 @@ async (req: RequestWithExtraFields, res: Response, next: NextFunction) => { } export const sleep = (ms: number): Promise => new Promise((r) => setTimeout(r, ms)) - -export function getDirPathFromFileUrl(fileUrl: string): string { - return fileURLToPath(dirname(fileUrl)) -} - -export async function importJsFilesFromDir( - pathToDir: string, - whitelistedFileNames: string[] | null = null -): Promise { - return new Promise((resolve, reject) => { - readdir(pathToDir, async (err, files) => { - if (err) { - return reject(err) - } - const importPromises = files - .filter((file) => file.endsWith('.js') && isWhitelistedFileName(file)) - .map((file) => import(`${pathToDir}/${file}`)) - resolve(Promise.all(importPromises)) - }) - }) - - function isWhitelistedFileName(fileName: string) { - // No whitelist means all files are whitelisted - if (!Array.isArray(whitelistedFileNames)) { - return true - } - - return whitelistedFileNames.some((whitelistedFileName) => fileName === whitelistedFileName) - } -} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/tsconfig.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/tsconfig.json new file mode 100644 index 0000000000..a7030c61d5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspCompile-golden/waspCompile/.wasp/out/web-app/src/universal/types.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/types.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/universal/types.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/types.ts diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/universal/url.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/url.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/universal/url.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/url.ts diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/validators.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/validators.ts new file mode 100644 index 0000000000..3d30d9622a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/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/waspJob-golden/waspJob/.wasp/out/sdk/wasp/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/nodemon.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/nodemon.json index 9ac8c1df77..01fe71701a 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/nodemon.json +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/nodemon.json @@ -4,7 +4,9 @@ }, "watch": [ "src/", + "../../../src/", ".env" ], + "comment-filip": "We now have to watch ../../../src/ because we're importing client files directly", "ext": "ts,mts,js,mjs,json" } diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/package.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/package.json index 22e5b4ca41..dd943c4429 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/package.json +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/package.json @@ -1,20 +1,16 @@ { + "comment-filip": "The server.js location changed because we have now included client source files above .wasp/out/server/src.", "dependencies": { - "@prisma/client": "4.16.2", "cookie-parser": "~1.4.6", "cors": "^2.8.5", "dotenv": "16.0.2", "express": "~4.18.1", "helmet": "^6.0.0", "jsonwebtoken": "^8.5.1", - "lodash.merge": "^4.6.2", "morgan": "~1.10.0", - "patch-package": "^6.4.7", - "pg-boss": "^8.4.2", "rate-limiter-flexible": "^2.4.1", "secure-password": "^4.0.0", - "superjson": "^1.12.2", - "uuid": "^9.0.0" + "superjson": "^1.12.2" }, "devDependencies": { "@tsconfig/node18": "latest", @@ -22,38 +18,32 @@ "@types/express": "^4.17.13", "@types/express-serve-static-core": "^4.17.13", "@types/node": "^18.0.0", - "@types/uuid": "^9.0.0", "nodemon": "^2.0.19", - "prisma": "4.16.2", - "standard": "^17.0.0", - "typescript": "^5.1.0" + "rollup": "^4.9.6", + "rollup-plugin-esbuild": "^6.1.1", + "standard": "^17.0.0" }, "engineStrict": true, "engines": { - "node": ">=18.0.0" + "node": ">=18.18.0" }, "name": "server", "nodemonConfig": { "delay": "1000" }, - "overrides": { - "secure-password": { - "sodium-native": "3.3.0" - } - }, + "overrides": {}, "prisma": {}, "private": true, "scripts": { - "build": "npx tsc", - "build-and-start": "npm run build && npm run start", + "bundle": "rollup --config --silent", + "bundle-and-start": "npm run bundle && npm run start", "db-migrate-prod": "prisma migrate deploy --schema=../db/schema.prisma", - "db-seed": "npm run build && NODE_PATH=dist node -r dotenv/config dist/dbSeed.js", - "postinstall": "patch-package", + "db-seed": "npm run bundle && node --enable-source-maps -r dotenv/config bundle/dbSeed.js", "standard": "standard", - "start": "npm run validate-env && NODE_PATH=dist node -r dotenv/config dist/server.js", + "start": "npm run validate-env && node --enable-source-maps -r dotenv/config bundle/server.js", "start-production": "NODE_ENV=production npm run start", "validate-env": "node -r dotenv/config ./scripts/validate-env.mjs", - "watch": "nodemon --exec 'npm run build-and-start || exit 1'" + "watch": "nodemon --exec 'npm run bundle-and-start || exit 1'" }, "type": "module", "version": "0.0.0" diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/rollup.config.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/rollup.config.js new file mode 100644 index 0000000000..9f0b986fb9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/rollup.config.js @@ -0,0 +1,24 @@ +import esbuild from 'rollup-plugin-esbuild' + +export default [ + createBundle('src/server.ts', 'bundle/server.js'), +] + +function createBundle(inputFilePath, outputFilePath) { + return { + input: inputFilePath, + output: { + file: outputFilePath, + format: 'es', + sourcemap: true, + }, + plugins: [ + esbuild({ + target: 'esnext', + }), + ], + // We don't want to bundle any of the node_module deps + // as we want to keep them as external dependencies + external: (id) => !/^[./]/.test(id), + } +} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/scripts/universal/validators.mjs b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/scripts/universal/validators.mjs deleted file mode 100644 index 9e3605d3b5..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/scripts/universal/validators.mjs +++ /dev/null @@ -1,21 +0,0 @@ -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`); - } -} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/scripts/validate-env.mjs index fb68580bbb..ac264b7961 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/scripts/validate-env.mjs +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/scripts/validate-env.mjs @@ -1,4 +1,4 @@ -import { throwIfNotValidAbsoluteURL } from './universal/validators.mjs'; +import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; console.info("🔍 Validating environment variables..."); throwIfNotValidAbsoluteURL(process.env.WASP_WEB_CLIENT_URL, 'Environment variable WASP_WEB_CLIENT_URL'); diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/actions/types.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/actions/types.ts index b5fa48def7..183065b864 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/actions/types.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/actions/types.ts @@ -1,4 +1,4 @@ import { type Payload, -} from '../_types' +} from 'wasp/server/_types' diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/app.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/app.js index a15cb96cea..025a3c4c14 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/app.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/app.js @@ -1,6 +1,6 @@ import express from 'express' -import HttpError from './core/HttpError.js' +import { HttpError } from 'wasp/server' import indexRouter from './routes/index.js' // TODO: Consider extracting most of this logic into createApp(routes, path) function so that diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/core/AuthError.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/core/AuthError.js deleted file mode 100644 index 2d965c168e..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/core/AuthError.js +++ /dev/null @@ -1,17 +0,0 @@ -class AuthError extends Error { - constructor (message, data, ...params) { - super(message, ...params) - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, AuthError) - } - - this.name = this.constructor.name - - if (data) { - this.data = data - } - } -} - -export default AuthError diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/dbClient.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/dbClient.ts deleted file mode 100644 index 66e7801be3..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/dbClient.ts +++ /dev/null @@ -1,12 +0,0 @@ -import Prisma from '@prisma/client' - - -const createDbClient = () => { - const prismaClient = new Prisma.PrismaClient() - - return prismaClient -} - -const dbClient = createDbClient() - -export default dbClient diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/dbSeed/types.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/dbSeed/types.ts deleted file mode 100644 index fe0d5396a4..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/dbSeed/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { PrismaClient } from '@prisma/client' - -export type DbSeedFn = (prismaClient: PrismaClient) => Promise diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/MySpecialJob.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/MySpecialJob.ts deleted file mode 100644 index 4e65d91038..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/MySpecialJob.ts +++ /dev/null @@ -1,17 +0,0 @@ -import prisma from '../dbClient.js' -import type { JSONValue, JSONObject } from '../_types/serialization.js' -import { createJob, type JobFn } from './core/pgBoss/pgBossJob.js' -import { foo } from '../ext-src/jobs/bar.js' - -const entities = { -}; - -export type MySpecialJob = JobFn - -export const MySpecialJob = createJob({ - jobName: "MySpecialJob", - jobFn: foo, - defaultJobOptions: {}, - jobSchedule: null, - entities, -}) diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/core/allJobs.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/core/allJobs.ts index e7aaa9853c..55438834d3 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/core/allJobs.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/core/allJobs.ts @@ -1,5 +1,5 @@ -// This module exports all jobs and is imported by the server to ensure +// This module imports all jobs and is imported by the server to ensure // any schedules that are not referenced are still loaded by NodeJS. -export { MySpecialJob } from '../MySpecialJob.js' +import '../mySpecialJob.js' diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/mySpecialJob.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/mySpecialJob.ts new file mode 100644 index 0000000000..e6c21cd3a5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/mySpecialJob.ts @@ -0,0 +1,8 @@ +import { registerJob } from 'wasp/server/jobs/core/pgBoss' +import { foo } from '../../../../../src/server/jobs/bar.js' +import { mySpecialJob as _waspJobDefinition } from 'wasp/server/jobs' + +registerJob({ + job: _waspJobDefinition, + jobFn: foo, +}) diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/middleware/globalMiddleware.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/middleware/globalMiddleware.ts index 2eca3e9f74..ce46c57ead 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/middleware/globalMiddleware.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/middleware/globalMiddleware.ts @@ -4,14 +4,12 @@ import logger from 'morgan' import cors from 'cors' import helmet from 'helmet' -import config from '../config.js' +import { config } from 'wasp/server' +import type { MiddlewareConfig, MiddlewareConfigFn } from 'wasp/server/middleware' +export type { MiddlewareConfig, MiddlewareConfigFn } from 'wasp/server/middleware' const _waspGlobalMiddlewareConfigFn = (mc: MiddlewareConfig) => mc -export type MiddlewareConfig = Map - -export type MiddlewareConfigFn = (middlewareConfig: MiddlewareConfig) => MiddlewareConfig - // This is the set of middleware Wasp supplies by default. // NOTE: Remember to update the docs of these change. const defaultGlobalMiddlewareConfig: MiddlewareConfig = new Map([ diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/middleware/operations.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/middleware/operations.ts index cea765236b..a86f8a8157 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/middleware/operations.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/middleware/operations.ts @@ -2,7 +2,7 @@ import { deserialize as superjsonDeserialize, serialize as superjsonSerialize, } from 'superjson' -import { handleRejection } from '../utils.js' +import { handleRejection } from 'wasp/server/utils' export function createOperation (handlerFn) { return handleRejection(async (req, res) => { diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/queries/types.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/queries/types.ts index 8024d29f08..a156fb294a 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/queries/types.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/queries/types.ts @@ -1,5 +1,5 @@ import { type Payload, -} from '../_types' +} from 'wasp/server/_types' diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/server.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/server.ts index 01edef6b1b..93d8c4d9ab 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/server.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/server.ts @@ -1,10 +1,10 @@ import http from 'http' import app from './app.js' -import config from './config.js' +import { config } from 'wasp/server' -import { startPgBoss } from './jobs/core/pgBoss/pgBoss.js' +import { startPgBoss } from 'wasp/server/jobs/core/pgBoss' import './jobs/core/allJobs.js' diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/universal/types.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/universal/types.ts deleted file mode 100644 index 8cadbd740d..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/universal/types.ts +++ /dev/null @@ -1,31 +0,0 @@ -// 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/waspJob-golden/waspJob/.wasp/out/server/src/universal/url.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/universal/url.ts deleted file mode 100644 index d21c06c65c..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/universal/url.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function stripTrailingSlash(url?: string): string | undefined { - return url?.replace(/\/$/, ""); -} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/tsconfig.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/tsconfig.json index f0ce78775e..68d7a47b0d 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/tsconfig.json +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/tsconfig.json @@ -2,7 +2,33 @@ "extends": "@tsconfig/node18/tsconfig.json", "compilerOptions": { // Overriding this until we implement more complete TypeScript support. + // Filip: begin client file hacks + // We need this to make server work with copied client files (we copy everything) + "jsx": "preserve", + "lib": [ + "esnext", + "dom", + "DOM.Iterable" + ], + // Filip: end client file hacks "strict": false, + // When left unspecified, the 'rootDir' defaults to the longest common path of + // all non-declaration input files. TypeScript mimics the source structure + // inside the output directory (i.e., 'dist'). + // + // Since Wasp apps can (but don't have to) import user files from + // '../../../src', it makes the rootDir's default value inconsistent: + // - When the app doesn't import user files (e.g., the user didn't specify + // any operations), the rootDir is set to the server source dir (/src). + // - When the app imports user files (as is the case for most Wasp apps), + // the rootDir is set to the Wasp project root (../../../). + // + // Our build script (in package.json) requires a consistent structure of + // the output directory, which is why we always make sure to point the rootDir + // to the Wasp project root (../../../). + // + // See this comment for more details: https://github.com/wasp-lang/wasp/pull/1584#discussion_r1404019301 + "rootDir": "../../../", // Overriding this because we want to use top-level await "module": "esnext", "target": "es2017", @@ -10,12 +36,13 @@ "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 }, - "include": ["src"] -} + "include": [ + "src" + ] +} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/package.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/package.json index a3cbf2e34b..5a226845a2 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/package.json +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/package.json @@ -12,35 +12,24 @@ ] }, "dependencies": { - "@prisma/client": "4.16.2", "@tanstack/react-query": "^4.29.0", "axios": "^1.4.0", "mitt": "3.0.0", - "react": "^18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.45.4", "react-router-dom": "^5.3.3", "superjson": "^1.12.2" }, "devDependencies": { - "@testing-library/jest-dom": "^5.16.5", - "@testing-library/react": "^14.0.0", "@tsconfig/vite-react": "^2.0.0", - "@types/react": "^18.0.37", "@types/react-dom": "^18.0.11", "@types/react-router-dom": "^5.3.3", - "@vitejs/plugin-react-swc": "^3.0.0", - "@vitest/ui": "^0.29.3", - "dotenv": "^16.0.3", - "jsdom": "^21.1.1", - "msw": "^1.1.0", - "typescript": "^5.1.0", - "vite": "^4.3.9", - "vitest": "^0.29.3" + "@vitejs/plugin-react": "^4.2.1", + "dotenv": "^16.0.3" }, "engineStrict": true, "engines": { - "node": ">=18.0.0" + "node": ">=18.18.0" }, "name": "waspJob", "private": true, diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/public/.gitkeep b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/public/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/scripts/universal/validators.mjs b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/scripts/universal/validators.mjs deleted file mode 100644 index 9e3605d3b5..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/scripts/universal/validators.mjs +++ /dev/null @@ -1,21 +0,0 @@ -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`); - } -} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/scripts/validate-env.mjs index 27d6a9fd59..18ee507c9e 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/scripts/validate-env.mjs +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/scripts/validate-env.mjs @@ -1,4 +1,4 @@ -import { throwIfNotValidAbsoluteURL } from './universal/validators.mjs'; +import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; console.info("🔍 Validating environment variables..."); throwIfNotValidAbsoluteURL(process.env.REACT_APP_API_URL, 'Environemnt variable REACT_APP_API_URL'); diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/ext-src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/ext-src/MainPage.jsx deleted file mode 100644 index c53ad8abaa..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/ext-src/MainPage.jsx +++ /dev/null @@ -1,40 +0,0 @@ -import waspLogo from './waspLogo.png' -import './Main.css' - -const 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. -

- - -
-
- ) -} -export default MainPage diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/ext-src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/ext-src/vite-env.d.ts deleted file mode 100644 index 1623b9c79c..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/ext-src/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/ext-src/vite.config.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/ext-src/vite.config.ts deleted file mode 100644 index a55924e2b6..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/ext-src/vite.config.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { defineConfig } from 'vite' - -export default defineConfig({ - server: { - open: true, - }, -}) diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/index.tsx b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/index.tsx index 17d6749e4a..0b7f1d9854 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/index.tsx +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/index.tsx @@ -6,7 +6,7 @@ import router from './router' import { initializeQueryClient, queryClientInitialized, -} from './queryClient' +} from 'wasp/client/operations' diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/queries/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/queries/index.d.ts deleted file mode 100644 index c007ff4c92..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/queries/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { UseQueryResult } from "@tanstack/react-query"; - -export type Query = { - (queryCacheKey: string[], args: Input): Promise -} - -export function useQuery( - queryFn: Query, - queryFnArgs?: Input, options?: any -): UseQueryResult diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/queries/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/queries/index.js deleted file mode 100644 index 03e52ce0f9..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/queries/index.js +++ /dev/null @@ -1,18 +0,0 @@ -import { useQuery as rqUseQuery } from '@tanstack/react-query' -export { configureQueryClient } from '../queryClient' - -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 - }) -} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/router.tsx b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/router.tsx index a18069e2e3..b5ca2c4620 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/router.tsx +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/router.tsx @@ -1,27 +1,15 @@ import React from 'react' import { Route, Switch, BrowserRouter as Router } from 'react-router-dom' -import { interpolatePath } from './router/linkHelpers' -import type { - RouteDefinitionsToRoutes, - OptionalRouteOptions, - ParamValue, -} from './router/types' -import MainPage from './ext-src/MainPage.jsx' +import { MainPage } from '../../../../src/MainPage.jsx' -export const routes = { - RootRoute: { - to: "/", - component: MainPage, - build: ( - options?: OptionalRouteOptions, - ) => interpolatePath("/", undefined, options.search, options.hash), - }, -} as const; +import { routes } from 'wasp/client/router' -export type Routes = RouteDefinitionsToRoutes +export const routeNameToRouteComponent = { + RootRoute: MainPage, +} as const; const router = ( @@ -31,7 +19,7 @@ const router = ( exact key={routeKey} path={route.to} - component={route.component} + component={routeNameToRouteComponent[routeKey]} /> ))} @@ -39,5 +27,3 @@ const router = ( ) export default router - -export { Link } from './router/Link' diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/test/vitest/setup.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/test/vitest/setup.ts index d263e51f4f..f62fc46590 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/test/vitest/setup.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/test/vitest/setup.ts @@ -1,4 +1,8 @@ -import matchers from '@testing-library/jest-dom/matchers' -import { expect } from 'vitest' +import { afterEach } from 'vitest' +import { cleanup } from '@testing-library/react' +import '@testing-library/jest-dom/vitest' -expect.extend(matchers) +// runs a clean after each test case (e.g. clearing jsdom) +afterEach(() => { + cleanup(); +}) diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/universal/types.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/universal/types.ts deleted file mode 100644 index 8cadbd740d..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/universal/types.ts +++ /dev/null @@ -1,31 +0,0 @@ -// 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/waspJob-golden/waspJob/.wasp/out/web-app/src/universal/url.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/universal/url.ts deleted file mode 100644 index d21c06c65c..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/universal/url.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function stripTrailingSlash(url?: string): string | undefined { - return url?.replace(/\/$/, ""); -} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/tsconfig.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/tsconfig.json index 968a1bb47f..4e7d14e1cd 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/tsconfig.json +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/tsconfig.json @@ -6,8 +6,14 @@ "allowJs": true, "strict": false, // Allow importing pages with the .tsx extension. - "allowImportingTsExtensions": true + "allowImportingTsExtensions": true, }, - "include": ["src"], - "references": [{ "path": "./tsconfig.node.json" }] -} + "include": [ + "src" + ], + "references": [ + { + "path": "./tsconfig.node.json" + } + ] +} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/vite.config.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/vite.config.ts index 0bc670f493..ed2d3dd5f0 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/vite.config.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/vite.config.ts @@ -1,13 +1,19 @@ /// import { mergeConfig } from "vite"; -import react from "@vitejs/plugin-react-swc"; +import react from "@vitejs/plugin-react"; +import { defaultExclude } from "vitest/config" -import customViteConfig from './src/ext-src/vite.config' +// Ignoring the TS error because we are importing a file outside of TS root dir. +// @ts-ignore +import customViteConfig from '../../../vite.config' const _waspUserProvidedConfig = customViteConfig const defaultViteConfig = { base: "/", plugins: [react()], + optimizeDeps: { + exclude: ['wasp'] + }, server: { port: 3000, host: "0.0.0.0", @@ -17,9 +23,22 @@ const defaultViteConfig = { build: { outDir: "build", }, + resolve: { + // These packages rely on a single instance per page. Not dedpuing them + // causes runtime errors (e.g., hook rule violation in react, QueryClient + // instance error in react-query, Invariant Error in react-router-dom). + dedupe: ["react", "react-dom", "@tanstack/react-query", "react-router-dom"] + }, test: { + globals: true, environment: "jsdom", - setupFiles: ["./src/test/vitest/setup.ts"], + // Since Vitest is running from the root of the project, we need + // to specify the path to the setup file relative to the root. + setupFiles: ['.wasp/out/web-app/src/test/vitest/setup.ts'], + exclude: [ + ...defaultExclude, + ".wasp/**/*", + ] }, }; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/.waspignore b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.waspignore similarity index 100% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/.waspignore rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.waspignore diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/main.wasp b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/main.wasp index 2e5bcb97ea..56ce5cf247 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/main.wasp +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/main.wasp @@ -8,12 +8,12 @@ app waspJob { route RootRoute { path: "/", to: MainPage } page MainPage { - component: import Main from "@client/MainPage.jsx" + component: import { MainPage } from "@src/MainPage.jsx" } - job MySpecialJob { + job mySpecialJob { executor: PgBoss, perform: { - fn: import { foo } from "@server/jobs/bar.js" + fn: import { foo } from "@src/server/jobs/bar.js" } } diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/package.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/package.json new file mode 100644 index 0000000000..c05321e7c3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/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": "waspJob" +} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/public/.gitkeep b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/public/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/Main.css b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/Main.css similarity index 100% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/Main.css rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/Main.css diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/MainPage.jsx new file mode 100644 index 0000000000..01aae7c3db --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/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/waspJob-golden/waspJob/src/client/MainPage.jsx b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/MainPage.jsx deleted file mode 100644 index c53ad8abaa..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/MainPage.jsx +++ /dev/null @@ -1,40 +0,0 @@ -import waspLogo from './waspLogo.png' -import './Main.css' - -const 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. -

- - -
-
- ) -} -export default MainPage diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/tsconfig.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/tsconfig.json deleted file mode 100644 index d501a4193a..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/tsconfig.json +++ /dev/null @@ -1,55 +0,0 @@ -// =============================== IMPORTANT ================================= -// -// This file is only used for Wasp IDE support. You can change it to configure -// your IDE checks, but none of these options will affect the TypeScript -// compiler. Proper TS compiler configuration in Wasp is coming soon :) -{ - "compilerOptions": { - // JSX support - "jsx": "preserve", - "strict": true, - // Allow default imports. - "esModuleInterop": true, - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - // Wasp needs the following settings enable IDE support in your source - // files. Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/web-app/", - "paths": { - // Resolve all "@wasp" imports to the generated source code. - "@wasp/*": [ - "src/*" - ], - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": [ - "../../.wasp/out/web-app/node_modules/@types" - ], - // Since this TS config is used only for IDE support and not for - // compilation, the following directory doesn't exist. We need to specify - // it to prevent this error: - // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file - "outDir": "phantom" - }, - "exclude": [ - "phantom" - ], -} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/vite-env.d.ts deleted file mode 100644 index 1623b9c79c..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/vite.config.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/vite.config.ts deleted file mode 100644 index a55924e2b6..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/vite.config.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { defineConfig } from 'vite' - -export default defineConfig({ - server: { - open: true, - }, -}) diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/server/tsconfig.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/server/tsconfig.json deleted file mode 100644 index 70a79b44ee..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/server/tsconfig.json +++ /dev/null @@ -1,48 +0,0 @@ -// =============================== IMPORTANT ================================= -// -// This file is only used for Wasp IDE support. You can change it to configure -// your IDE checks, but none of these options will affect the TypeScript -// compiler. Proper TS compiler configuration in Wasp is coming soon :) -{ - "compilerOptions": { - // Allows default imports. - "esModuleInterop": true, - "allowJs": true, - "strict": true, - // Wasp needs the following settings enable IDE support in your source - // files. Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/server/", - "paths": { - // Resolve all "@wasp" imports to the generated source code. - "@wasp/*": [ - "src/*" - ], - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": [ - "../../.wasp/out/server/node_modules/@types" - ], - // Since this TS config is used only for IDE support and not for - // compilation, the following directory doesn't exist. We need to specify - // it to prevent this error: - // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file - "outDir": "phantom", - }, - "exclude": [ - "phantom" - ], -} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/shared/tsconfig.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/shared/tsconfig.json deleted file mode 100644 index 20fcac8431..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/shared/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - // Enable default imports in TypeScript. - "esModuleInterop": true, - "allowJs": true, - // The following settings enable IDE support in user-provided source files. - // Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/server/", - "paths": { - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": ["../../.wasp/out/server/node_modules/@types"] - } -} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/waspLogo.png b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/waspLogo.png similarity index 100% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/client/waspLogo.png rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/waspLogo.png diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/tsconfig.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/tsconfig.json new file mode 100644 index 0000000000..a05fb4efd3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/tsconfig.json @@ -0,0 +1,34 @@ +// =============================== IMPORTANT ================================= +// +// This file is only used for Wasp IDE support. You can change it to configure +// your IDE checks, but none of these options will affect the TypeScript +// compiler. Proper TS compiler configuration in Wasp is coming soon :) +{ + "compilerOptions": { + // JSX support + "jsx": "preserve", + "strict": true, + // Allow default imports. + "esModuleInterop": true, + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "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" + ], + // Since this TS config is used only for IDE support and not for + // compilation, the following directory doesn't exist. We need to specify + // it to prevent this error: + // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file + "outDir": "phantom", + }, + "exclude": [ + "phantom" + ], +} diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/client/vite.config.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/vite.config.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/src/client/vite.config.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/vite.config.ts diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest b/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest index 3738a312e8..a792673393 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest @@ -3,29 +3,199 @@ waspMigrate/.wasp/out/.waspchecksums waspMigrate/.wasp/out/Dockerfile waspMigrate/.wasp/out/db/migrations/migration_lock.toml waspMigrate/.wasp/out/db/migrations/no-date-foo/migration.sql -waspMigrate/.wasp/out/db/package.json waspMigrate/.wasp/out/db/schema.prisma waspMigrate/.wasp/out/db/schema.prisma.wasp-generate-checksum waspMigrate/.wasp/out/db/schema.prisma.wasp-last-db-concurrence-checksum -waspMigrate/.wasp/out/installedFullStackNpmDependencies.json +waspMigrate/.wasp/out/installedNpmDepsLog.json +waspMigrate/.wasp/out/sdk/wasp/api/events.ts +waspMigrate/.wasp/out/sdk/wasp/api/index.ts +waspMigrate/.wasp/out/sdk/wasp/client/index.ts +waspMigrate/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts +waspMigrate/.wasp/out/sdk/wasp/client/operations/actions/core.js +waspMigrate/.wasp/out/sdk/wasp/client/operations/actions/index.ts +waspMigrate/.wasp/out/sdk/wasp/client/operations/core.ts +waspMigrate/.wasp/out/sdk/wasp/client/operations/index.ts +waspMigrate/.wasp/out/sdk/wasp/client/operations/internal/index.ts +waspMigrate/.wasp/out/sdk/wasp/client/operations/internal/resources.js +waspMigrate/.wasp/out/sdk/wasp/client/operations/internal/updateHandlersMap.js +waspMigrate/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts +waspMigrate/.wasp/out/sdk/wasp/client/operations/queries/core.js +waspMigrate/.wasp/out/sdk/wasp/client/operations/queries/index.ts +waspMigrate/.wasp/out/sdk/wasp/client/operations/queryClient.ts +waspMigrate/.wasp/out/sdk/wasp/client/router/Link.tsx +waspMigrate/.wasp/out/sdk/wasp/client/router/index.ts +waspMigrate/.wasp/out/sdk/wasp/client/router/linkHelpers.ts +waspMigrate/.wasp/out/sdk/wasp/client/router/types.ts +waspMigrate/.wasp/out/sdk/wasp/client/test/index.ts +waspMigrate/.wasp/out/sdk/wasp/client/test/vitest/helpers.tsx +waspMigrate/.wasp/out/sdk/wasp/core/config.ts +waspMigrate/.wasp/out/sdk/wasp/core/storage.ts +waspMigrate/.wasp/out/sdk/wasp/dev/index.ts +waspMigrate/.wasp/out/sdk/wasp/dist/api/events.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/api/events.js +waspMigrate/.wasp/out/sdk/wasp/dist/api/events.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/api/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/api/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/api/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/core.js +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/core.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js +waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/router/Link.jsx +waspMigrate/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/router/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/router/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/client/router/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js +waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/router/types.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/router/types.js +waspMigrate/.wasp/out/sdk/wasp/dist/client/router/types.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/test/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/test/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/client/test/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx +waspMigrate/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map +waspMigrate/.wasp/out/sdk/wasp/dist/core/config.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/core/config.js +waspMigrate/.wasp/out/sdk/wasp/dist/core/config.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/core/storage.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/core/storage.js +waspMigrate/.wasp/out/sdk/wasp/dist/core/storage.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/dev/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/dev/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/dev/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/entities/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/entities/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/entities/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx +waspMigrate/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map +waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js +waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/serialization.js +waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js +waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/server/config.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js +waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.js +waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/server/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js +waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js +waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js +waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/server/types/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/server/types/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/server/types/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/server/utils.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/server/utils.js +waspMigrate/.wasp/out/sdk/wasp/dist/server/utils.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.js +waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.js +waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/universal/validators.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/universal/validators.js +waspMigrate/.wasp/out/sdk/wasp/dist/universal/validators.js.map +waspMigrate/.wasp/out/sdk/wasp/entities/index.ts +waspMigrate/.wasp/out/sdk/wasp/ext-src/Main.css +waspMigrate/.wasp/out/sdk/wasp/ext-src/MainPage.jsx +waspMigrate/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts +waspMigrate/.wasp/out/sdk/wasp/ext-src/waspLogo.png +waspMigrate/.wasp/out/sdk/wasp/package.json +waspMigrate/.wasp/out/sdk/wasp/server/HttpError.ts +waspMigrate/.wasp/out/sdk/wasp/server/_types/index.ts +waspMigrate/.wasp/out/sdk/wasp/server/_types/serialization.ts +waspMigrate/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts +waspMigrate/.wasp/out/sdk/wasp/server/config.ts +waspMigrate/.wasp/out/sdk/wasp/server/dbClient.ts +waspMigrate/.wasp/out/sdk/wasp/server/index.ts +waspMigrate/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts +waspMigrate/.wasp/out/sdk/wasp/server/middleware/index.ts +waspMigrate/.wasp/out/sdk/wasp/server/operations/actions/index.ts +waspMigrate/.wasp/out/sdk/wasp/server/operations/actions/types.ts +waspMigrate/.wasp/out/sdk/wasp/server/operations/index.ts +waspMigrate/.wasp/out/sdk/wasp/server/operations/queries/index.ts +waspMigrate/.wasp/out/sdk/wasp/server/operations/queries/types.ts +waspMigrate/.wasp/out/sdk/wasp/server/types/index.ts +waspMigrate/.wasp/out/sdk/wasp/server/utils.ts +waspMigrate/.wasp/out/sdk/wasp/tsconfig.json +waspMigrate/.wasp/out/sdk/wasp/universal/types.ts +waspMigrate/.wasp/out/sdk/wasp/universal/url.ts +waspMigrate/.wasp/out/sdk/wasp/universal/validators.ts +waspMigrate/.wasp/out/sdk/wasp/vite-env.d.ts waspMigrate/.wasp/out/server/.env waspMigrate/.wasp/out/server/.npmrc waspMigrate/.wasp/out/server/README.md waspMigrate/.wasp/out/server/nodemon.json waspMigrate/.wasp/out/server/package.json -waspMigrate/.wasp/out/server/scripts/universal/validators.mjs +waspMigrate/.wasp/out/server/rollup.config.js waspMigrate/.wasp/out/server/scripts/validate-env.mjs -waspMigrate/.wasp/out/server/src/_types/index.ts -waspMigrate/.wasp/out/server/src/_types/serialization.ts -waspMigrate/.wasp/out/server/src/_types/taggedEntities.ts waspMigrate/.wasp/out/server/src/actions/types.ts waspMigrate/.wasp/out/server/src/app.js -waspMigrate/.wasp/out/server/src/config.js -waspMigrate/.wasp/out/server/src/core/AuthError.js -waspMigrate/.wasp/out/server/src/core/HttpError.js -waspMigrate/.wasp/out/server/src/dbClient.ts -waspMigrate/.wasp/out/server/src/dbSeed/types.ts -waspMigrate/.wasp/out/server/src/entities/index.ts waspMigrate/.wasp/out/server/src/middleware/globalMiddleware.ts waspMigrate/.wasp/out/server/src/middleware/index.ts waspMigrate/.wasp/out/server/src/middleware/operations.ts @@ -34,10 +204,6 @@ waspMigrate/.wasp/out/server/src/queries/types.ts waspMigrate/.wasp/out/server/src/routes/index.js waspMigrate/.wasp/out/server/src/routes/operations/index.js waspMigrate/.wasp/out/server/src/server.ts -waspMigrate/.wasp/out/server/src/types/index.ts -waspMigrate/.wasp/out/server/src/universal/types.ts -waspMigrate/.wasp/out/server/src/universal/url.ts -waspMigrate/.wasp/out/server/src/utils.ts waspMigrate/.wasp/out/server/tsconfig.json waspMigrate/.wasp/out/web-app/.env waspMigrate/.wasp/out/web-app/.npmrc @@ -45,58 +211,31 @@ waspMigrate/.wasp/out/web-app/README.md waspMigrate/.wasp/out/web-app/index.html waspMigrate/.wasp/out/web-app/netlify.toml waspMigrate/.wasp/out/web-app/package.json +waspMigrate/.wasp/out/web-app/public/.gitkeep waspMigrate/.wasp/out/web-app/public/favicon.ico waspMigrate/.wasp/out/web-app/public/manifest.json -waspMigrate/.wasp/out/web-app/scripts/universal/validators.mjs waspMigrate/.wasp/out/web-app/scripts/validate-env.mjs -waspMigrate/.wasp/out/web-app/src/actions/core.d.ts -waspMigrate/.wasp/out/web-app/src/actions/core.js -waspMigrate/.wasp/out/web-app/src/actions/index.ts -waspMigrate/.wasp/out/web-app/src/api.ts -waspMigrate/.wasp/out/web-app/src/api/events.ts -waspMigrate/.wasp/out/web-app/src/config.js waspMigrate/.wasp/out/web-app/src/entities/index.ts -waspMigrate/.wasp/out/web-app/src/ext-src/Main.css -waspMigrate/.wasp/out/web-app/src/ext-src/MainPage.jsx -waspMigrate/.wasp/out/web-app/src/ext-src/vite-env.d.ts -waspMigrate/.wasp/out/web-app/src/ext-src/vite.config.ts -waspMigrate/.wasp/out/web-app/src/ext-src/waspLogo.png waspMigrate/.wasp/out/web-app/src/index.tsx waspMigrate/.wasp/out/web-app/src/logo.png -waspMigrate/.wasp/out/web-app/src/operations/index.ts -waspMigrate/.wasp/out/web-app/src/operations/resources.js -waspMigrate/.wasp/out/web-app/src/operations/updateHandlersMap.js -waspMigrate/.wasp/out/web-app/src/queries/core.d.ts -waspMigrate/.wasp/out/web-app/src/queries/core.js -waspMigrate/.wasp/out/web-app/src/queries/index.d.ts -waspMigrate/.wasp/out/web-app/src/queries/index.js waspMigrate/.wasp/out/web-app/src/queryClient.js waspMigrate/.wasp/out/web-app/src/router.tsx -waspMigrate/.wasp/out/web-app/src/router/Link.tsx -waspMigrate/.wasp/out/web-app/src/router/linkHelpers.ts -waspMigrate/.wasp/out/web-app/src/router/types.ts -waspMigrate/.wasp/out/web-app/src/storage.ts -waspMigrate/.wasp/out/web-app/src/test/index.ts -waspMigrate/.wasp/out/web-app/src/test/vitest/helpers.tsx waspMigrate/.wasp/out/web-app/src/test/vitest/setup.ts -waspMigrate/.wasp/out/web-app/src/types.ts -waspMigrate/.wasp/out/web-app/src/universal/types.ts -waspMigrate/.wasp/out/web-app/src/universal/url.ts waspMigrate/.wasp/out/web-app/src/utils.js waspMigrate/.wasp/out/web-app/src/vite-env.d.ts waspMigrate/.wasp/out/web-app/tsconfig.json waspMigrate/.wasp/out/web-app/tsconfig.node.json waspMigrate/.wasp/out/web-app/vite.config.ts +waspMigrate/.waspignore waspMigrate/.wasproot waspMigrate/main.wasp waspMigrate/migrations/migration_lock.toml waspMigrate/migrations/no-date-foo/migration.sql -waspMigrate/src/.waspignore -waspMigrate/src/client/Main.css -waspMigrate/src/client/MainPage.jsx -waspMigrate/src/client/tsconfig.json -waspMigrate/src/client/vite-env.d.ts -waspMigrate/src/client/vite.config.ts -waspMigrate/src/client/waspLogo.png -waspMigrate/src/server/tsconfig.json -waspMigrate/src/shared/tsconfig.json +waspMigrate/package.json +waspMigrate/public/.gitkeep +waspMigrate/src/Main.css +waspMigrate/src/MainPage.jsx +waspMigrate/src/vite-env.d.ts +waspMigrate/src/waspLogo.png +waspMigrate/tsconfig.json +waspMigrate/vite.config.ts diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/.waspchecksums b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/.waspchecksums index 4d50ee0978..8db5594781 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/.waspchecksums @@ -2,555 +2,632 @@ [ [ "file", - ".dockerignore" + "../out/sdk/wasp/api/events.ts" ], - "a2a5ebe3785244437c0d490b4bfa1652c84b9ab0d4f25566fd7e69d1421d7a1b" + "91ec1889f649b608ca81cab8f048538b9dcc70f49444430b1e5b572af2a4970a" ], [ [ "file", - "Dockerfile" + "../out/sdk/wasp/api/index.ts" ], - "f50d77dfca7624b691d0e5b002aeb1b7dc3302c9a761fb06ad502893507c0ad1" + "6d69f0df651dd19d0a9cd137ee4a0d536358269b6bd91c25efaa6c254f06948a" ], [ [ "file", - "db/schema.prisma" + "../out/sdk/wasp/client/index.ts" ], - "8d017edd849a861ae086850270a9f817bb4b75d9ee9ac27c08b0e9c29a16f6fe" + "526d2f787c68b0be87064eb4c7771394f2987b6669b5fd39f9d240dcbfc2356c" ], [ [ "file", - "server/.env" + "../out/sdk/wasp/client/operations/actions/core.d.ts" ], - "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + "676855c039620769cc6ac728149d263c438024e5888ea0afd7f575507a95682a" ], [ [ "file", - "server/.gitignore" + "../out/sdk/wasp/client/operations/actions/core.js" ], - "2c3d81dd719ff91d51609a02d03ba62ad456e2c50763b7b4c761395cb583f890" + "620a4aefbab701dd47b8bf21a07fc4e081ae1fd297261c5af7a05f21f558dff1" ], [ [ "file", - "server/.npmrc" + "../out/sdk/wasp/client/operations/actions/index.ts" ], - "8a74b1091affea3c71c2cf04acbaa38c4a51a261a9a98dcc9e96473d07a85a27" + "cada58ebdd19f239b97a4cc6bfc1d37b855022629457ddb0c03ff9317aa8e8f0" ], [ [ "file", - "server/README.md" + "../out/sdk/wasp/client/operations/core.ts" ], - "e14514b8b152dd2160a217d8fc66a710c8607c4ed1441a2148a0770701818249" + "bad860771b16a0d4830fab22de8b85e63c840d47dc3728728a23b8ada91061ef" ], [ [ "file", - "server/nodemon.json" + "../out/sdk/wasp/client/operations/index.ts" ], - "c4c69994805c8e0d993bd39fec9e52478b5e656bae565fa1c19ef378901a7139" + "4a66c90319dd7ef0d3a8e6c1f571037c7dfd9778b9def6e951813dbc4b4dcef3" ], [ [ "file", - "server/package.json" + "../out/sdk/wasp/client/operations/internal/index.ts" ], - "83afe0de90f49262e41706a8af0b734743bc6c10579c0cd16b9c222c00f0bbfe" + "0cd5c744f0d883d48a6c1ddf8eacbe48059e123e79c5f39fad2d17073b6c9f9e" ], [ [ "file", - "server/scripts/universal/validators.mjs" + "../out/sdk/wasp/client/operations/internal/resources.js" ], - "94edf3906c43fb476b22244d07a5d69fd6c967de767532ed5b3215e2a6eee91b" + "0f3a0e4d19ceff419a6343ab5162d8b0985673f9d3d7d76bd4471fae0076fe17" ], [ [ "file", - "server/scripts/validate-env.mjs" + "../out/sdk/wasp/client/operations/internal/updateHandlersMap.js" ], - "b507ff0f8cbdac18a0b42ccbb7acda9a5cd88e0ac5f95ca3d42341944298062d" + "07a9933a771853585fd2fc49c3dcb9f1cad947acb2168580c835fae25620fa9f" ], [ [ "file", - "server/src/_types/index.ts" + "../out/sdk/wasp/client/operations/queries/core.d.ts" ], - "acb5c13b3ef2e05225a0e63ea22e1ecdc52660de76155300b50e048501e3d8da" + "8ca19541652926772e2a7c5d88b5497b7760e98bc9d19c9a217bd03d83cec97d" ], [ [ "file", - "server/src/_types/serialization.ts" + "../out/sdk/wasp/client/operations/queries/core.js" ], - "73dc983c9a02cab8e2f189f1ddedd9cdcd47bf403c9dc56efba8be895b6980a1" + "34425abc901cd6294ca902df6b0c080aeafe2b3abf5b539c5e622020601f838e" ], [ [ "file", - "server/src/_types/taggedEntities.ts" + "../out/sdk/wasp/client/operations/queries/index.ts" ], - "b67f60b2d02d0280c73a1199736ce2c335ee2021b621a32e18a5f335cd109a20" + "9d188907e5a3175e1bdada1c242ee4741eb866598d06d9d71d73a01e7a9a8ba2" ], [ [ "file", - "server/src/actions/types.ts" + "../out/sdk/wasp/client/operations/queryClient.ts" ], - "a994ed1f89011c04014deb57a2c26d09c216491caac9269380a7c14d1718b313" + "5c1d87ac10513788bcde7ebc7c10601b9ad0854cddff355e8fb7e2d4685ecdef" ], [ [ "file", - "server/src/app.js" + "../out/sdk/wasp/client/router/Link.tsx" + ], + "80db39a38f50833f8c965bfd7758da990083db60a6f2f8e394353eed5f981cc9" + ], + [ + [ + "file", + "../out/sdk/wasp/client/router/index.ts" ], - "86504ede1daeca35cc93f665ca8ac2fdf46ecaff02f6d3a7810a14d2bc71e16a" + "6fe430c2956c25c3833d6893c695523a7b2a5f1cb9eceb0bed26429c2e33e6a0" ], [ [ "file", - "server/src/config.js" + "../out/sdk/wasp/client/router/linkHelpers.ts" ], - "d135535e045e5f5852e0b6d8bd49360e7231021cd38b540f419f5f44c6158dc2" + "62e48c724070c59a95c837288112922326e1351ee1defa4759bdc47f7361ce9e" ], [ [ "file", - "server/src/core/AuthError.js" + "../out/sdk/wasp/client/router/types.ts" ], - "5ac18ed20c5c8b192a75d1cb2f36906d5ff9f0951451a2ef08d9ab62fc26b8bb" + "d6feb23110d8cae5c94badd5cdec320207e1a5406cb827eb684aa4cffc3d7050" ], [ [ "file", - "server/src/core/HttpError.js" + "../out/sdk/wasp/client/test/index.ts" ], - "fa06ff60ab8183e8d00c13805692fc8cd3b5a21408edce4f0949d5b913e066b1" + "cb2e2dc33df8afc0d4453f4322a4e2af92f3345e9622e0416fa87e34d6acb9d8" + ], + [ + [ + "file", + "../out/sdk/wasp/client/test/vitest/helpers.tsx" + ], + "e0fbaf237a21b52ff47897fb1f1b1bffb0085670b71ba7d0b1d90547ab5a8f3b" ], [ [ "file", - "server/src/dbClient.ts" + "../out/sdk/wasp/core/config.ts" ], - "f26bfa4a60022d45195f3179548c4b09305f6a9cfe301b5edd1615677a59ae3f" + "12a7dffb1c3fe762cec8d9d928af353cb169ff199d3934b1f3c27ce0e3a2f987" + ], + [ + [ + "file", + "../out/sdk/wasp/core/storage.ts" + ], + "e9e2a4a02d48bea1597fcdc00592e3d975eea7fa6e0545cf087da9429c5f4979" ], [ [ "file", - "server/src/dbSeed/types.ts" + "../out/sdk/wasp/dev/index.ts" ], - "47442c546d286164c2cdb3359deb45b47f115df2ca72bb181b4639bee2059d38" + "1c15a2858ffe39f3ef83e53705cb25b00f09e895c04cf1a354210b5babdde895" ], [ [ "file", - "server/src/entities/index.ts" + "../out/sdk/wasp/entities/index.ts" ], "c5077f0d9a9224986a1c42b54de449e48af1f2b9ecc8778eb44cd55ebd9d23a7" ], [ [ "file", - "server/src/middleware/globalMiddleware.ts" + "../out/sdk/wasp/ext-src/Main.css" ], - "5ecfd79481386c7ba17747a6d786166c8a7f95e331462d15303e1abf7cd031b7" + "1583ce49887ea575e563dab0c7ad6d2e2e3e6a351ed7c2f80c310641b1456417" ], [ [ "file", - "server/src/middleware/index.ts" + "../out/sdk/wasp/ext-src/MainPage.jsx" ], - "e658719309f9375f389c5d8d416fc27f9c247049e61188b3e01df954bcec15a4" + "4aead352bd5bbb5134b5e1f0927cf94966d80aa9dbbbb1f616e79fec8ae594e4" ], [ [ "file", - "server/src/middleware/operations.ts" + "../out/sdk/wasp/ext-src/vite-env.d.ts" ], - "864c7492c27f6da1e67645fbc358dc803a168852bfd24f2c4dd13fccf6917b07" + "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5" ], [ [ "file", - "server/src/polyfill.ts" + "../out/sdk/wasp/ext-src/waspLogo.png" ], - "66d3dca514bdd01be402714d0dfe3836e76f612346dea57ee595ae4f3da915cf" + "0f05a89eb945d6d7326110e88776e402833b356202b06d0a8bf652e118d3fd2f" ], [ [ "file", - "server/src/queries/types.ts" + "../out/sdk/wasp/package.json" ], - "276f022c04936bfe75d593fe8426a0aaf43a0e9c085042ad1b6560ad23041031" + "8c4e7254985043dbada72ea8caa14dc82e154e5d1d3384677b7986f9ba8ef833" ], [ [ "file", - "server/src/routes/index.js" + "../out/sdk/wasp/server/HttpError.ts" ], - "c34f77a96150414957386f5645c9becb12725c9f231aaaa8db798e3564bd75ce" + "eaa296c30acc65c78b90ebdf9a1d6fdb863f0c26c743d352afaeaa3bbc2fdd1b" ], [ [ "file", - "server/src/routes/operations/index.js" + "../out/sdk/wasp/server/_types/index.ts" ], - "d09f7dcf78ed2da15f488afb08e62d9dac15f173fdbe779323dfdd75330f5de5" + "3790f4753154f796d48c63c953284aac38d5421476e00fd7f854aac164c4adbc" ], [ [ "file", - "server/src/server.ts" + "../out/sdk/wasp/server/_types/serialization.ts" ], - "d0666b659cdc75db181ea2bbb50c4e157f0a7fbe00c4ff8fda0933b1a13e5a0e" + "cfa5bcdd91e36fe35a91323bd3944a52873144101a5a03ae8a4f258cdd61ea03" ], [ [ "file", - "server/src/types/index.ts" + "../out/sdk/wasp/server/_types/taggedEntities.ts" ], - "f7621082fc7d8467a0967eb0bd82ff7956052b766e9e82d50584b8de88e0d28a" + "d80e8c2e35e837fbd739b33541671da8db15f21ccf235963c904f362381ea2c3" ], [ [ "file", - "server/src/universal/types.ts" + "../out/sdk/wasp/server/config.ts" ], - "8ef378c1447289104856ec1a92931fd1280c0f8d0a8463008674e93bd798b884" + "4976e545d8fcf019508e95f472305e9ef27dfb3423c71e428a5414e35cdd52be" ], [ [ "file", - "server/src/universal/url.ts" + "../out/sdk/wasp/server/dbClient.ts" ], - "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" + "c5f88f028ad62b4a2fd5d1206aa72165f74c6f46f96250512af6ae55a5354020" ], [ [ "file", - "server/src/utils.ts" + "../out/sdk/wasp/server/index.ts" ], - "6a664e44a89efe8ed8cb7559a84bd2871422c38287b276fee2a7aed4680e1d1e" + "51c3e0802764f72b88f6daaf148dba514ae817e233a40cc9b92ec91784f71f98" ], [ [ "file", - "server/tsconfig.json" + "../out/sdk/wasp/server/middleware/globalMiddleware.ts" ], - "51a60d6350537a9e0696674aae86b122a7dea2a4497d294fd4fd6bc47b7e9808" + "53f258be83ca6de653b6b645253ce573e3c177e88017eb2adb17f5d3cebb36c3" ], [ [ "file", - "web-app/.env" + "../out/sdk/wasp/server/middleware/index.ts" ], - "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + "e658719309f9375f389c5d8d416fc27f9c247049e61188b3e01df954bcec15a4" ], [ [ "file", - "web-app/.gitignore" + "../out/sdk/wasp/server/operations/actions/index.ts" ], - "d373417ea2a8844e3b7a1515aab123e90fbeb4b7225144d55d243d9f6f04f73a" + "c67a0c7d8946f5c465edea2de78e78537384bd6f30ec4f4fd6dfe58243f4f36a" ], [ [ "file", - "web-app/.npmrc" + "../out/sdk/wasp/server/operations/actions/types.ts" ], - "7151cf397def0c2cb0ab65643701d27d335a72c90f775675b5f826bc7005818a" + "cc03111599e32695d677e8ac4e65b98cf90e0cb066e71c3da06af254c784b489" ], [ [ "file", - "web-app/README.md" + "../out/sdk/wasp/server/operations/index.ts" ], - "6af47b8c26fa9d30e9b774e6c38d3456a3b469c3101bffb186e2a1fb325a93f4" + "b185af725a91995c8eb76d1c3560a488e9caef664d0add8620e2ea387e2be7f8" ], [ [ "file", - "web-app/index.html" + "../out/sdk/wasp/server/operations/queries/index.ts" ], - "be16520d0a664cda0212f52f7d42d5839415e8dd4a6ff025f6063e5b4b1f852d" + "c67a0c7d8946f5c465edea2de78e78537384bd6f30ec4f4fd6dfe58243f4f36a" ], [ [ "file", - "web-app/netlify.toml" + "../out/sdk/wasp/server/operations/queries/types.ts" ], - "854009c7d1b2630a55099439f89e4947188ea4160c9d1388b46b5a5cf6ab461a" + "19f72a3a37efd1e29b0793caa7f379494ad236bb513c8c8804b5a8d305c45196" ], [ [ "file", - "web-app/package.json" + "../out/sdk/wasp/server/types/index.ts" ], - "6944ae2b282c643c5045a0996ff9f81018010a73744384eeced581bab01e4f53" + "0f2ffdfdd76c92084bd0ba270b674628ec907da0d047de6c8a9912e415462d97" ], [ [ "file", - "web-app/public/favicon.ico" + "../out/sdk/wasp/server/utils.ts" ], - "1481f03584b46b63182c1f8d26e61a95ce4d8fae032b2b4f3fe5e00ab7e96c23" + "a4178a3e2527d47d141340b99abf675125859fa9cb5a0535e3efa7b34a3bcabb" ], [ [ "file", - "web-app/public/manifest.json" + "../out/sdk/wasp/tsconfig.json" ], - "c91b7ea515a4889c4abfd355500c8260210602093a94c0beee302450272c3737" + "5a1d45e247132b9afbfabb9073749a924a86bfefe945a954c1f44ec672e1fef3" ], [ [ "file", - "web-app/scripts/universal/validators.mjs" + "../out/sdk/wasp/universal/types.ts" ], - "94edf3906c43fb476b22244d07a5d69fd6c967de767532ed5b3215e2a6eee91b" + "8ef378c1447289104856ec1a92931fd1280c0f8d0a8463008674e93bd798b884" ], [ [ "file", - "web-app/scripts/validate-env.mjs" + "../out/sdk/wasp/universal/url.ts" ], - "690460410bc9b28a8e96c6e20902e841f07b77faccf3db7e7249f48f700f4bab" + "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" ], [ [ "file", - "web-app/src/actions/core.d.ts" + "../out/sdk/wasp/universal/validators.ts" ], - "34b44699906b98ca28050479b66254e64073a403b571a8fd1a227395d27becae" + "80c624ff5caa11fcaa66c74eb3a473dbedc9bbac3ece740361d7752f5f45d38f" ], [ [ "file", - "web-app/src/actions/core.js" + "../out/sdk/wasp/vite-env.d.ts" ], - "f38003d51d9754952bf595a25fdb44580d88af3bcd6658848cf8a339a8240689" + "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5" ], [ [ "file", - "web-app/src/actions/index.ts" + ".dockerignore" ], - "607c3311861456ae47c246a950c8e29593f9837a9f5c48923d99cd7fac1ce0bb" + "a2a5ebe3785244437c0d490b4bfa1652c84b9ab0d4f25566fd7e69d1421d7a1b" ], [ [ "file", - "web-app/src/api.ts" + "Dockerfile" ], - "850331885230117aa56317186c6d38f696fb1fbd0c56470ff7c6e4f3c1c43104" + "782bbb77a9342451751614eead1ee402aa37376d60d19e8ea4cc4635686de95d" ], [ [ "file", - "web-app/src/api/events.ts" + "db/schema.prisma" ], - "91ec1889f649b608ca81cab8f048538b9dcc70f49444430b1e5b572af2a4970a" + "d2eb9a55059dba91cad5f97ddef72cdd764e65fba16c5875ccdfe2a79460269a" ], [ [ "file", - "web-app/src/config.js" + "server/.env" ], - "b06175129dd8be8ca6c307fafa02646d47233c4e26fdfeea6d7802d02e9513f3" + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ], [ [ "file", - "web-app/src/entities/index.ts" + "server/.gitignore" ], - "cfb888ebcfafcc416b6e7d583081053d3fa2aa8b7be7d4e21d5f547e731d2467" + "2c3d81dd719ff91d51609a02d03ba62ad456e2c50763b7b4c761395cb583f890" ], [ [ "file", - "web-app/src/ext-src/Main.css" + "server/.npmrc" ], - "1583ce49887ea575e563dab0c7ad6d2e2e3e6a351ed7c2f80c310641b1456417" + "8a74b1091affea3c71c2cf04acbaa38c4a51a261a9a98dcc9e96473d07a85a27" ], [ [ "file", - "web-app/src/ext-src/MainPage.jsx" + "server/README.md" ], - "8ee7fe1352719facadf0935eb45df8661ba13015277ea80be5a9200c66a31bde" + "e14514b8b152dd2160a217d8fc66a710c8607c4ed1441a2148a0770701818249" ], [ [ "file", - "web-app/src/ext-src/vite-env.d.ts" + "server/nodemon.json" ], - "d677883c270ee71acc9bfd95c824650b541036599427a8ffc0ad33323d08e61d" + "6cb3f8539e5cf59e29e3c97c9b4fa405600ea132784e4f47f79555951f47bd38" ], [ [ "file", - "web-app/src/ext-src/vite.config.ts" + "server/package.json" ], - "797dfb8022557b5ce5ce856daca01911974497f9ccf656f5920e5b42a986f4f8" + "e1d6bcee1015a57675ec3c05ecc2890b853b9d02d937cf9c5fcb3f2cc60e0f47" ], [ [ "file", - "web-app/src/ext-src/waspLogo.png" + "server/rollup.config.js" ], - "0f05a89eb945d6d7326110e88776e402833b356202b06d0a8bf652e118d3fd2f" + "c1beb8264f11898364288d73b16f08d1923bac5f70038d9827978deb5b58a2da" ], [ [ "file", - "web-app/src/index.tsx" + "server/scripts/validate-env.mjs" ], - "d10c443130afd9848fcfa631424590784e70dc1c66a8b7a9a8c1dfa9dd7ad5df" + "65168a764fc6cbe785ee40a8e8533b4694ef9019fc5a73f60f7252152330d0a2" ], [ [ "file", - "web-app/src/logo.png" + "server/src/actions/types.ts" ], - "35f14abf46cb0e9d9b4e3d11961917eecb86be65a0d7f4e6bc9713c5766b5f1b" + "cc03111599e32695d677e8ac4e65b98cf90e0cb066e71c3da06af254c784b489" ], [ [ "file", - "web-app/src/operations/index.ts" + "server/src/app.js" ], - "7ec3870a9313ec17d2282f9002da4a5d4da3c096c5fb0927acd008f1bec60bb3" + "a10bb6f3daab886b0685994368711fd7718a2a3e50a9329cd7da6394b9c59302" ], [ [ "file", - "web-app/src/operations/resources.js" + "server/src/middleware/globalMiddleware.ts" ], - "c08445d84f9931ebc3e4f975017bf88c03b6bee9aa588e945d52fe3aee9c4d70" + "312850493f4b17b42d5878b1c41be7db66e11bf5cf1997f9506cb06ee05ab5bd" ], [ [ "file", - "web-app/src/operations/updateHandlersMap.js" + "server/src/middleware/index.ts" ], - "07a9933a771853585fd2fc49c3dcb9f1cad947acb2168580c835fae25620fa9f" + "e658719309f9375f389c5d8d416fc27f9c247049e61188b3e01df954bcec15a4" ], [ [ "file", - "web-app/src/queries/core.d.ts" + "server/src/middleware/operations.ts" ], - "8ac475ed46a373ddc47e37dd557315c9c15abcde527749bb40c08527130e0567" + "23efbb9c408f8c12bdb77359a48177430b7da636163562d0105560891ac225b9" ], [ [ "file", - "web-app/src/queries/core.js" + "server/src/polyfill.ts" ], - "3ac4a8402a7d6af3eb4a90ec59bcfdd32585f3f2dc6d6bed8a1140cea8fdb7f2" + "66d3dca514bdd01be402714d0dfe3836e76f612346dea57ee595ae4f3da915cf" ], [ [ "file", - "web-app/src/queries/index.d.ts" + "server/src/queries/types.ts" ], - "f3a7cf037867cd7f8ce76cbca5e5eb2aacb9ca69933c182bce2f7ff935c4d385" + "19f72a3a37efd1e29b0793caa7f379494ad236bb513c8c8804b5a8d305c45196" ], [ [ "file", - "web-app/src/queries/index.js" + "server/src/routes/index.js" ], - "8379699fa710f43d5be2b96f3a5c7c551a8d3d9db3ef0fea964502da00f36ffc" + "c34f77a96150414957386f5645c9becb12725c9f231aaaa8db798e3564bd75ce" ], [ [ "file", - "web-app/src/queryClient.js" + "server/src/routes/operations/index.js" ], - "1739d8618286b4a2aa536bd3fcb754514c828ec896b69c7074e22f66c07e7b03" + "d09f7dcf78ed2da15f488afb08e62d9dac15f173fdbe779323dfdd75330f5de5" ], [ [ "file", - "web-app/src/router.tsx" + "server/src/server.ts" ], - "067478c4990bbe966fa1984cd9db91aba9aaa68196c5858eab787eb376ab48b9" + "ab9d7722a512f2a51a81a63de0b81172421dc86a6556c49f70aab4683d57657f" ], [ [ "file", - "web-app/src/router/Link.tsx" + "server/tsconfig.json" ], - "7b6214295d59d8dffbd61b82f9dab2b080b2d7ebe98cc7d9f9e8c229f99a890d" + "ae9b0031fd08188a5fa7ab0a0994dfe9bdbd1d8f2e1ba2df4f609b9b470eb6b4" ], [ [ "file", - "web-app/src/router/linkHelpers.ts" + "web-app/.env" ], - "c296ed5e7924ad1173f4f0fb4dcce053cffd5812612069b5f62d1bf9e96495cf" + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ], [ [ "file", - "web-app/src/router/types.ts" + "web-app/.gitignore" ], - "7f08b262987c17f953c4b95814631a7aaac82eb77660bcb247ef7bf866846fe1" + "d373417ea2a8844e3b7a1515aab123e90fbeb4b7225144d55d243d9f6f04f73a" ], [ [ "file", - "web-app/src/storage.ts" + "web-app/.npmrc" ], - "e9e2a4a02d48bea1597fcdc00592e3d975eea7fa6e0545cf087da9429c5f4979" + "7151cf397def0c2cb0ab65643701d27d335a72c90f775675b5f826bc7005818a" ], [ [ "file", - "web-app/src/test/index.ts" + "web-app/README.md" ], - "cb2e2dc33df8afc0d4453f4322a4e2af92f3345e9622e0416fa87e34d6acb9d8" + "6af47b8c26fa9d30e9b774e6c38d3456a3b469c3101bffb186e2a1fb325a93f4" ], [ [ "file", - "web-app/src/test/vitest/helpers.tsx" + "web-app/index.html" ], - "a38e55c9999a87ab497538bcad7c880f32a4d27f2227ae326cb76eb0848b89e9" + "be16520d0a664cda0212f52f7d42d5839415e8dd4a6ff025f6063e5b4b1f852d" ], [ [ "file", - "web-app/src/test/vitest/setup.ts" + "web-app/netlify.toml" ], - "1c08b10e428cec3939e0ab269c9a02694e196de7c5dd9f18372424bdccbc5028" + "854009c7d1b2630a55099439f89e4947188ea4160c9d1388b46b5a5cf6ab461a" ], [ [ "file", - "web-app/src/types.ts" + "web-app/package.json" ], - "282f6bdef1e7e8846ad53909bbf88c54cd04a0594b77b1e87cb69266de84cc6d" + "19a5d3854b7614748db2af7b574afc66951d5b6eff128ca3eab36445b331686f" ], [ [ "file", - "web-app/src/universal/types.ts" + "web-app/public/.gitkeep" ], - "8ef378c1447289104856ec1a92931fd1280c0f8d0a8463008674e93bd798b884" + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ], [ [ "file", - "web-app/src/universal/url.ts" + "web-app/public/favicon.ico" ], - "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" + "1481f03584b46b63182c1f8d26e61a95ce4d8fae032b2b4f3fe5e00ab7e96c23" + ], + [ + [ + "file", + "web-app/public/manifest.json" + ], + "c91b7ea515a4889c4abfd355500c8260210602093a94c0beee302450272c3737" + ], + [ + [ + "file", + "web-app/scripts/validate-env.mjs" + ], + "a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd" + ], + [ + [ + "file", + "web-app/src/entities/index.ts" + ], + "cfb888ebcfafcc416b6e7d583081053d3fa2aa8b7be7d4e21d5f547e731d2467" + ], + [ + [ + "file", + "web-app/src/index.tsx" + ], + "ff83778b7f03a8f15116bc73adce607c2c13fc9cbd4228626980a530541aaeb2" + ], + [ + [ + "file", + "web-app/src/logo.png" + ], + "35f14abf46cb0e9d9b4e3d11961917eecb86be65a0d7f4e6bc9713c5766b5f1b" + ], + [ + [ + "file", + "web-app/src/queryClient.js" + ], + "1739d8618286b4a2aa536bd3fcb754514c828ec896b69c7074e22f66c07e7b03" + ], + [ + [ + "file", + "web-app/src/router.tsx" + ], + "aaa46223db86cf8a7af9c2fe89d50345e0d9b3fa2587e91f4680810d032db452" + ], + [ + [ + "file", + "web-app/src/test/vitest/setup.ts" + ], + "610e936776aaa39e861f0b2a83b0c0290d74ca8123d9d5409e5f2183384fdb52" ], [ [ @@ -571,7 +648,7 @@ "file", "web-app/tsconfig.json" ], - "f1b31ca75b2b32c5b0441aec4fcd7f285c18346761ba1640761d6253d65e3580" + "dfeee6d883ed2504c149c64b24ca939c0ad4812b78bfdced7293a386a008effd" ], [ [ @@ -585,6 +662,6 @@ "file", "web-app/vite.config.ts" ], - "08962d79f2d71eb470ee85dee03db6deca7ede28df9d41542bbaea752db0eeed" + "64256d93d81f6192f419e836ed4484f0e8c1e28f018bfb3213851608200594ac" ] ] \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/Dockerfile b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/Dockerfile index 43fe65d7ef..33b4765557 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/Dockerfile +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/Dockerfile @@ -2,7 +2,7 @@ # Because if not, we had situations where it would use the different version # locally and on Github CI. This way we ensure exact version is used, # and also have control over updating it (instead of update surprising us). -FROM node:18-alpine3.17 AS node +FROM node:18.18.0-alpine3.17 AS node # We split Dockerfile into base, server-builder and server-production. @@ -17,16 +17,29 @@ FROM node AS base RUN apk --no-cache -U upgrade # To ensure any potential security patches are applied. +# Todo: The 'server-builder' image stays on disk under : and is +# relatively large (~900 MB), should we remove it? Or is it useful for future +# builds? FROM base AS server-builder -RUN apk add --no-cache build-base libtool autoconf automake +# Building the Docker image on Apple's Silicon Mac fails without python3 (the build +# throws `node-gyp` errors when it tries to compile native deps. Installing +# `python3` fixes the issue. +RUN apk add --no-cache python3 build-base libtool autoconf automake WORKDIR /app -COPY server/ ./server/ +# Since the framwork code in /.wasp/build/server imports the user code in /src +# using relative imports, we must mirror the same directory structure in the +# Docker image. +COPY src ./src +COPY package.json . +COPY package-lock.json . +COPY .wasp/build/server .wasp/build/server +COPY .wasp/out/sdk .wasp/out/sdk # Install npm packages, resulting in node_modules/. -RUN cd server && npm install -COPY db/schema.prisma ./db/ -RUN cd server && PRISMA_CLIENT_OUTPUT_DIR=../server/node_modules/.prisma/client/ npx prisma generate --schema='../db/schema.prisma' +RUN npm install && cd .wasp/build/server && npm install +COPY .wasp/build/db/schema.prisma .wasp/build/db/ +RUN cd .wasp/build/server && npx prisma generate --schema='../db/schema.prisma' # Building the server should come after Prisma generation. -RUN cd server && npm run build +RUN cd .wasp/build/server && npm run bundle # TODO: Use pm2? @@ -36,13 +49,21 @@ FROM base AS server-production RUN apk add --no-cache python3 ENV NODE_ENV production WORKDIR /app -COPY --from=server-builder /app/server/node_modules ./server/node_modules -COPY --from=server-builder /app/server/dist ./server/dist -COPY --from=server-builder /app/server/package*.json ./server/ -COPY --from=server-builder /app/server/scripts ./server/scripts -COPY db/ ./db/ +# Copying the top level 'node_modules' because it contains the Prisma packages +# necessary for migrating the database. +COPY --from=server-builder /app/node_modules ./node_modules +# Copying the SDK because 'validate-env.mjs' executes independent of the bundle +# and references the 'wasp' package. +COPY --from=server-builder /app/.wasp/out/sdk .wasp/out/sdk +# Copying 'server/node_modules' because 'validate-env.mjs' executes independent +# of the bundle and references the dotenv package. +COPY --from=server-builder /app/.wasp/build/server/node_modules .wasp/build/server/node_modules +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/ EXPOSE ${PORT} -WORKDIR /app/server +WORKDIR /app/.wasp/build/server ENTRYPOINT ["npm", "run", "start-production"] diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/db/package.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/db/package.json deleted file mode 100644 index c418219d3b..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/db/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "dependencies": { - "@prisma/client": "^4.16.2" - }, - "devDependencies": { - "prisma": "^4.16.2" - } -} diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/db/schema.prisma b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/db/schema.prisma index b081e85910..e0406df5c6 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/db/schema.prisma +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/db/schema.prisma @@ -6,7 +6,6 @@ datasource db { generator client { provider = "prisma-client-js" - output = env("PRISMA_CLIENT_OUTPUT_DIR") } model Task { diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/db/schema.prisma.wasp-generate-checksum b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/db/schema.prisma.wasp-generate-checksum index 421ad72ce6..5680399abe 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/db/schema.prisma.wasp-generate-checksum +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/db/schema.prisma.wasp-generate-checksum @@ -1 +1 @@ -8d017edd849a861ae086850270a9f817bb4b75d9ee9ac27c08b0e9c29a16f6fe \ No newline at end of file +d2eb9a55059dba91cad5f97ddef72cdd764e65fba16c5875ccdfe2a79460269a \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/db/schema.prisma.wasp-last-db-concurrence-checksum b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/db/schema.prisma.wasp-last-db-concurrence-checksum index 421ad72ce6..5680399abe 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/db/schema.prisma.wasp-last-db-concurrence-checksum +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/db/schema.prisma.wasp-last-db-concurrence-checksum @@ -1 +1 @@ -8d017edd849a861ae086850270a9f817bb4b75d9ee9ac27c08b0e9c29a16f6fe \ No newline at end of file +d2eb9a55059dba91cad5f97ddef72cdd764e65fba16c5875ccdfe2a79460269a \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/installedFullStackNpmDependencies.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/installedFullStackNpmDependencies.json deleted file mode 100644 index 7f7d12ca30..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/installedFullStackNpmDependencies.json +++ /dev/null @@ -1 +0,0 @@ -{"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"express","version":"~4.18.1"},{"name":"morgan","version":"~1.10.0"},{"name":"@prisma/client","version":"4.16.2"},{"name":"jsonwebtoken","version":"^8.5.1"},{"name":"secure-password","version":"^4.0.0"},{"name":"dotenv","version":"16.0.2"},{"name":"helmet","version":"^6.0.0"},{"name":"patch-package","version":"^6.4.7"},{"name":"uuid","version":"^9.0.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"nodemon","version":"^2.0.19"},{"name":"standard","version":"^17.0.0"},{"name":"prisma","version":"4.16.2"},{"name":"typescript","version":"^5.1.0"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/uuid","version":"^9.0.0"},{"name":"@types/cors","version":"^2.8.5"}]},"npmDepsForWebApp":{"dependencies":[{"name":"axios","version":"^1.4.0"},{"name":"react","version":"^18.2.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"@prisma/client","version":"4.16.2"},{"name":"superjson","version":"^1.12.2"},{"name":"mitt","version":"3.0.0"},{"name":"react-hook-form","version":"^7.45.4"}],"devDependencies":[{"name":"vite","version":"^4.3.9"},{"name":"typescript","version":"^5.1.0"},{"name":"@types/react","version":"^18.0.37"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react-swc","version":"^3.0.0"},{"name":"dotenv","version":"^16.0.3"},{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"vitest","version":"^0.29.3"},{"name":"@vitest/ui","version":"^0.29.3"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.0.0"},{"name":"@testing-library/jest-dom","version":"^5.16.5"},{"name":"msw","version":"^1.1.0"}]}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/installedNpmDepsLog.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/installedNpmDepsLog.json new file mode 100644 index 0000000000..a010ca4b88 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/installedNpmDepsLog.json @@ -0,0 +1 @@ +{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"4.16.2"},{"name":"prisma","version":"4.16.2"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.18.1"},{"name":"jsonwebtoken","version":"^8.5.1"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"secure-password","version":"^4.0.0"},{"name":"sodium-native","version":"3.3.0"},{"name":"superjson","version":"^1.12.2"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"uuid","version":"^9.0.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"4.16.2"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"mitt","version":"3.0.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"react-router-dom","version":"^5.3.3"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@types/react-router-dom","version":"^5.3.3"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"16.0.2"},{"name":"express","version":"~4.18.1"},{"name":"helmet","version":"^6.0.0"},{"name":"jsonwebtoken","version":"^8.5.1"},{"name":"morgan","version":"~1.10.0"},{"name":"rate-limiter-flexible","version":"^2.4.1"},{"name":"secure-password","version":"^4.0.0"},{"name":"superjson","version":"^1.12.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"},{"name":"standard","version":"^17.0.0"}]}}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/api/events.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/api/events.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/api/events.ts rename to waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/api/events.ts diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/api/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/api/index.ts new file mode 100644 index 0000000000..d066bd5448 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/index.ts new file mode 100644 index 0000000000..1972713940 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts new file mode 100644 index 0000000000..894c01f91c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/actions/core.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/actions/core.js new file mode 100644 index 0000000000..17dd6aba4d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/actions/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/actions/index.ts new file mode 100644 index 0000000000..32207e1a69 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/actions/index.ts @@ -0,0 +1 @@ +import { createAction } from './core' diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/core.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/core.ts new file mode 100644 index 0000000000..282c4698a7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/index.ts new file mode 100644 index 0000000000..ec9ca9f689 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/internal/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/internal/index.ts new file mode 100644 index 0000000000..c274b5aa76 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/internal/resources.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/internal/resources.js new file mode 100644 index 0000000000..470ef70b82 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/operations/updateHandlersMap.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/internal/updateHandlersMap.js similarity index 100% rename from waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/operations/updateHandlersMap.js rename to waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/internal/updateHandlersMap.js diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts new file mode 100644 index 0000000000..ff8ae4a3b9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/queries/core.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/queries/core.js new file mode 100644 index 0000000000..c4b3e5f2e4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/queries/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/queries/index.ts new file mode 100644 index 0000000000..17f6f8e238 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/queryClient.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/queryClient.ts new file mode 100644 index 0000000000..c2d1cb86df --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/Link.tsx b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/Link.tsx new file mode 100644 index 0000000000..2215ddc639 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/index.ts new file mode 100644 index 0000000000..90f93b35f2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/linkHelpers.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/linkHelpers.ts new file mode 100644 index 0000000000..e10cba9281 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/types.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/router/types.ts new file mode 100644 index 0000000000..ffaeb4fe01 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/test/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/test/index.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/test/index.ts rename to waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/test/index.ts diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/test/vitest/helpers.tsx b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/test/vitest/helpers.tsx new file mode 100644 index 0000000000..8ffbc9a7b4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/core/config.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/core/config.ts new file mode 100644 index 0000000000..e9234e6f2a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/storage.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/core/storage.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/storage.ts rename to waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/core/storage.ts diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dev/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dev/index.ts new file mode 100644 index 0000000000..e9bd93f7da --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/events.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/events.d.ts new file mode 100644 index 0000000000..c5f6b6e5da --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/events.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/events.js new file mode 100644 index 0000000000..b405507c51 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/events.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/events.js.map new file mode 100644 index 0000000000..de0637d22d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.d.ts new file mode 100644 index 0000000000..634416ecd5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.js new file mode 100644 index 0000000000..2015c488dc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.js.map new file mode 100644 index 0000000000..15be79e1ef --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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;CACvB,CAAC,CAAA;AAEF,MAAM,6BAA6B,GAAG,WAAW,CAAA;AAEjD,IAAI,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAuB,CAAA;AAE3F,oBAAoB;AACpB,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,oBAAoB,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,SAAS,CAAC,CAAA;IACrD,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;AACxC,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,YAAY;IAC1B,OAAO,oBAAoB,CAAA;AAC7B,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,cAAc;IAC5B,oBAAoB,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAA;IAC7C,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;AAC1C,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,mBAAmB;IACjC,oBAAoB,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,KAAK,EAAE,CAAA;IACf,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;AAC1C,CAAC;AAED,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;IACvC,MAAM,SAAS,GAAG,YAAY,EAAE,CAAA;IAChC,IAAI,SAAS,EAAE;QACb,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,SAAS,EAAE,CAAA;KACzD;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAC,CAAA;AAEF,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;;IACjD,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,MAAK,GAAG,EAAE;QAClC,cAAc,EAAE,CAAA;KACjB;IACD,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC,CAAC,CAAA;AAEF,kFAAkF;AAClF,2DAA2D;AAC3D,6EAA6E;AAC7E,0FAA0F;AAC1F,sFAAsF;AACtF,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;IAC3C,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,cAAc,CAAC,6BAA6B,CAAC,EAAE;QACvE,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE;YACpB,oBAAoB,GAAG,KAAK,CAAC,QAAQ,CAAA;YACrC,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;SACvC;aAAM;YACL,oBAAoB,GAAG,SAAS,CAAA;YAChC,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;SACzC;KACF;AACH,CAAC,CAAC,CAAA;AAEF,oBAAoB;AACpB;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAuD;;IACpF,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EAAE;QACnB,wEAAwE;QACxE,8CAA8C;QAC9C,8EAA8E;QAC9E,8BAA8B;QAC9B,yEAAyE;QACzE,iEAAiE;QACjE,iFAAiF;QACjF,MAAM,YAAY,GAAG,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,CAAA;QACzC,MAAM,kBAAkB,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAA;QAChD,MAAM,IAAI,aAAa,CAAC,kBAAkB,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,mCAAI,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;KAClG;SAAM;QACL,4CAA4C;QAC5C,MAAM,KAAK,CAAA;KACZ;AACH,CAAC;AAED,MAAM,aAAc,SAAQ,KAAK;IAK/B,YAAa,UAAkB,EAAE,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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.d.ts new file mode 100644 index 0000000000..fd6cf83b9e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js new file mode 100644 index 0000000000..c13afdb0c7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js.map new file mode 100644 index 0000000000..b7394b3505 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/core.d.ts new file mode 100644 index 0000000000..e2c6699d11 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js new file mode 100644 index 0000000000..51abcbe936 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/core.js.map new file mode 100644 index 0000000000..5834336f1d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/actions/index.js.map new file mode 100644 index 0000000000..58e967cc07 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/core.d.ts new file mode 100644 index 0000000000..a23b24ebd6 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/core.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/core.js new file mode 100644 index 0000000000..2c94cb01fd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/core.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/core.js.map new file mode 100644 index 0000000000..68ea114aa9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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,CAAC,GAAG,OAAO,CAAC,aAAa,EAAE,WAAW,CAAC;QACzC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC5B,OAAO,UAAU,iBACf,QAAQ,EACR,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,WAAW,CAAC,IAC1C,OAAO,EACV,CAAC;AACL,CAAC;AAmDD,aAAa;AACb;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CACvB,QAA+B,EAC/B,aAAoC;IAEpC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,IAAI,UAAU,GAAG,QAAQ,CAAC;IAC1B,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,iBAAiB,EAAE;QACpC,MAAM,4BAA4B,GAAG,aAAa,CAAC,iBAAiB,CAAC,GAAG,CACtE,6BAA6B,CAC9B,CAAC;QACF,UAAU,GAAG,8BAA8B,CACzC,QAAQ,EACR,4BAA4B,CAC7B,CAAC;QACF,OAAO,GAAG,6BAA6B,CACrC,WAAW,EACX,4BAA4B,CAC7B,CAAC;KACH;IAED,wEAAwE;IACxE,2EAA2E;IAC3E,wEAAwE;IACxE,4EAA4E;IAC5E,4EAA4E;IAC5E,sEAAsE;IACtE,0CAA0C;IAC1C,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAC9C,CAAC;AAiCD;;;;;;;;GAQG;AACH,SAAS,6BAA6B,CACpC,gCAA8E;IAE9E,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,GAAG,gCAAgC,CAAC;IAE5E,MAAM,gBAAgB,GAAG,EAAE,CAAC;IAC5B,IAAI,OAAO,iBAAiB,KAAK,UAAU,EAAE;QAC3C,gBAAgB,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;KACjE;IACD,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;QACrC,gBAAgB,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;KAC3D;IACD,IAAI,gBAAgB,CAAC,MAAM,EAAE;QAC3B,MAAM,IAAI,SAAS,CACjB,yCAAyC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACxE,CAAC;KACH;IAED,OAAO;QACL,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,0BAA0B,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC1E,WAAW;KACZ,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,8BAA8B,CACrC,QAA+B,EAC/B,2BAGG;IAEH,OAAO,SAAS,kCAAkC,CAAC,IAAI;QACrD,MAAM,mCAAmC,GAAG,2BAA2B,CAAC,GAAG,CACzE,CAAC,iBAAiB,EAAE,EAAE,CACpB,4CAA4C,CAAC,iBAAiB,EAAE,IAAI,CAAC,CACxE,CAAC;QACF,OAAQ,QAA0C,CAAC,QAAQ,CACzD,IAAI,EACJ,mCAAmC,CACpC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAS,6BAA6B,CACpC,WAAwB,EACxB,2BAGG;IAEH,KAAK,UAAU,QAAQ,CAAC,IAAI;QAC1B,MAAM,mCAAmC,GAAG,2BAA2B,CAAC,GAAG,CACzE,CAAC,iBAAiB,EAAE,EAAE,CACpB,4CAA4C,CAAC,iBAAiB,EAAE,IAAI,CAAC,CACxE,CAAC;QAEF,iFAAiF;QACjF,iEAAiE;QACjE,4EAA4E;QAC5E,mFAAmF;QACnF,MAAM,OAAO,CAAC,GAAG,CACf,mCAAmC,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CACvD,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,CACpC,CACF,CAAC;QAEF,4EAA4E;QAC5E,MAAM,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,mCAAmC,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE;YACxE,uCAAuC;YACvC,MAAM,oBAAoB,GACxB,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YAErC,kEAAkE;YAClE,IAAI;gBACF,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;aACjD;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,KAAK,CACX,4EAA4E,CAC7E,CAAC;gBACF,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aAClB;YAED,iEAAiE;YACjE,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,YAAY,EAAE,CAAC;IAC1B,CAAC;IAED,SAAS,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO;QACnC,+EAA+E;QAC/E,8EAA8E;QAC9E,8EAA8E;QAC9E,+EAA+E;QAC/E,YAAY;QACZ,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;YACpD,MAAM,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAC1C,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,QAAQ;QACR,OAAO;KACR,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,4CAA4C,CACnD,0BAGC,EACD,IAAiB;IAEjB,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,0BAA0B,CAAC;IAChE,OAAO;QACL,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC;QAC3B,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/index.d.ts new file mode 100644 index 0000000000..301165fa8e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/index.js new file mode 100644 index 0000000000..f83307c7b1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/index.js.map new file mode 100644 index 0000000000..982c957a9a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.d.ts new file mode 100644 index 0000000000..e31c8b5a4b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js new file mode 100644 index 0000000000..68bbdadf3d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map new file mode 100644 index 0000000000..a4097ef8cb --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.d.ts new file mode 100644 index 0000000000..6f51eab82e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js new file mode 100644 index 0000000000..86ab763337 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/resources.js.map new file mode 100644 index 0000000000..c91fecd3c7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;KAC7B;AACH,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,sBAAsB;IAC7D,sBAAsB,CAAC,OAAO,CAC5B,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CACzE,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,SAAS,EAAE,sBAAsB;IACxE,sBAAsB,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAA;IACjF,MAAM,sBAAsB,CAAC,SAAS,CAAC,CAAA;AACzC,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,QAAQ;IACjD,OAAO,cAAc,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAA;AACnD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B;IAC9C,MAAM,WAAW,GAAG,MAAM,sBAAsB,CAAA;IAChD,wEAAwE;IACxE,8EAA8E;IAC9E,eAAe;IACf,iFAAiF;IACjF,6EAA6E;IAC7E,wFAAwF;IACxF,kFAAkF;IAClF,WAAW,CAAC,YAAY,EAAE,CAAA;IAC1B,6EAA6E;IAC7E,2DAA2D;IAC3D,WAAW,CAAC,aAAa,EAAE,CAAA;AAC7B,CAAC;AAED;;;GAGG;AACH,KAAK,UAAU,sBAAsB,CAAC,SAAS;IAC7C,MAAM,WAAW,GAAG,MAAM,sBAAsB,CAAA;IAEhD,MAAM,0BAA0B,GAAG,wBAAwB,CAAC,SAAS,CAAC,CAAA;IACtE,0BAA0B,CAAC,OAAO,CAChC,aAAa,CAAC,EAAE,CAAC,WAAW,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAC9D,CAAA;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,uBAAuB,CAAC,QAAQ;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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.d.ts new file mode 100644 index 0000000000..715b6d06a1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js new file mode 100644 index 0000000000..34f590b5d2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/updateHandlersMap.js.map new file mode 100644 index 0000000000..7940fcd972 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/core.d.ts new file mode 100644 index 0000000000..cf16c63f44 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js new file mode 100644 index 0000000000..13b2cdcc9b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/core.js.map new file mode 100644 index 0000000000..f8ad3284bd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts new file mode 100644 index 0000000000..575c502be1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/index.d.ts @@ -0,0 +1 @@ +export { addMetadataToQuery } from './core'; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js new file mode 100644 index 0000000000..1c28e8d0d3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queries/index.js.map new file mode 100644 index 0000000000..5c83611fa3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queryClient.d.ts new file mode 100644 index 0000000000..40df1fa863 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js new file mode 100644 index 0000000000..9dfeab443f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/queryClient.js.map new file mode 100644 index 0000000000..82e2b19139 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/Link.d.ts new file mode 100644 index 0000000000..fe53898b9f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/Link.jsx b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/Link.jsx new file mode 100644 index 0000000000..d38b7a9c65 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/Link.jsx.map new file mode 100644 index 0000000000..bb738bdad9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/index.d.ts new file mode 100644 index 0000000000..067b2fbd72 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/index.js new file mode 100644 index 0000000000..1a84b8d043 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/index.js.map new file mode 100644 index 0000000000..35eeff35e4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.d.ts new file mode 100644 index 0000000000..22fd81ec79 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js new file mode 100644 index 0000000000..144c9efc7c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/linkHelpers.js.map new file mode 100644 index 0000000000..064bcce597 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/types.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/types.d.ts new file mode 100644 index 0000000000..80d69a3452 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/types.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/types.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/router/types.js.map new file mode 100644 index 0000000000..7d60d60505 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/index.d.ts new file mode 100644 index 0000000000..b684c869ea --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/index.js new file mode 100644 index 0000000000..be0d1c7d5a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/index.js.map new file mode 100644 index 0000000000..33c10677b9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.d.ts new file mode 100644 index 0000000000..645112861a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx new file mode 100644 index 0000000000..fcc9fc0b7a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/test/vitest/helpers.jsx.map new file mode 100644 index 0000000000..de41e60937 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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,CAAA;AAC3D,OAAO,EAAE,IAAI,EAA2C,MAAM,KAAK,CAAA;AACnE,OAAO,EAAE,WAAW,EAAoB,MAAM,UAAU,CAAA;AACxD,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAgB,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEvD,OAAO,MAAM,MAAM,kBAAkB,CAAA;AACrC,OAAO,EAAE,UAAU,EAAS,MAAM,aAAa,CAAA;AAW/C,aAAa;AACb,+CAA+C;AAC/C,sIAAsI;AACtI,MAAM,UAAU,eAAe,CAAC,EAAgB;IAC9C,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAA;IAChC,MAAM,KAA0B,MAAM,CACpC,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAClC;MAAA,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CACtB;IAAA,EAAE,mBAAmB,CAAC,CACvB,EAJK,EAAE,QAAQ,OAIf,EAJoB,MAAM,cAArB,YAAuB,CAI5B,CAAA;IACD,uCACK,MAAM,KACT,QAAQ,EAAE,CAAC,UAAwB,EAAE,EAAE,CACrC,QAAQ,CACN,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAClC;UAAA,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,EAAE,MAAM,CAC9B;QAAA,EAAE,mBAAmB,CAAC,CACvB,IACJ;AACH,CAAC;AAED,aAAa;AACb,MAAM,UAAU,UAAU;IAKxB,MAAM,MAAM,GAAgB,WAAW,EAAE,CAAA;IAEzC,SAAS,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;IAChC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,CAAC,aAAa,EAAE,CAAA;QACtB,OAAO,EAAE,CAAA;IACX,CAAC,CAAC,CAAA;IACF,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAA;IAE9B,MAAM,SAAS,GAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC/C,MAAM,KAAK,GAAI,KAAqC,CAAC,KAAK,CAAA;QAC1D,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAC1C,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC5C,CAAA;IACH,CAAC,CAAA;IAED,MAAM,OAAO,GAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC3C,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;IACvE,CAAC,CAAA;IAED,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAA;AACvC,CAAC;AAED,SAAS,SAAS,CAChB,MAAmB,EACnB,KAAY,EACZ,eAAwD;IAExD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;QACrD,MAAM,IAAI,KAAK,CACb,yCACE,KAAK,CAAC,MACR,mCAAmC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC3E,CAAA;KACF;IAED,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IAE3C,MAAM,QAAQ,GAAyD;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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/config.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/config.d.ts new file mode 100644 index 0000000000..b567b37b9a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/config.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/config.js new file mode 100644 index 0000000000..85d8f7e943 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/config.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/config.js.map new file mode 100644 index 0000000000..aa55beed81 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/storage.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/storage.d.ts new file mode 100644 index 0000000000..1beeea0400 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/storage.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/storage.js new file mode 100644 index 0000000000..e54cbb3c51 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/storage.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/core/storage.js.map new file mode 100644 index 0000000000..b7cd5db441 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/dev/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/dev/index.d.ts new file mode 100644 index 0000000000..14157874a1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/dev/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/dev/index.js new file mode 100644 index 0000000000..bd25589418 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/dev/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/dev/index.js.map new file mode 100644 index 0000000000..6874fe15b7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/entities/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/entities/index.d.ts new file mode 100644 index 0000000000..872933a2cd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/entities/index.d.ts @@ -0,0 +1,4 @@ +import { type Task } from "@prisma/client"; +export { type Task, } from "@prisma/client"; +export type Entity = Task | never; +export type EntityName = "Task" | never; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/entities/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/entities/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/entities/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/entities/index.js.map new file mode 100644 index 0000000000..28316c97d8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts new file mode 100644 index 0000000000..891990a1cc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx new file mode 100644 index 0000000000..1ecd86d313 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map new file mode 100644 index 0000000000..bc78a183b9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts new file mode 100644 index 0000000000..56b8d88eca --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js new file mode 100644 index 0000000000..3e216e57ce --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js.map new file mode 100644 index 0000000000..34064e924c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts new file mode 100644 index 0000000000..d43e89e114 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/index.d.ts @@ -0,0 +1,21 @@ +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> = (req: Request, res: Response, context: Context) => void; +type EntityMap = { + [EntityName in Entities[number]["_entityName"]]: PrismaDelegate[EntityName]; +}; +export type PrismaDelegate = { + "Task": typeof prisma.task; +}; +type Context = Expand<{ + entities: Expand>; +}>; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/index.js new file mode 100644 index 0000000000..814a00a31f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/index.js.map new file mode 100644 index 0000000000..692d12face --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/serialization.d.ts new file mode 100644 index 0000000000..8338115ad9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/serialization.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/serialization.js new file mode 100644 index 0000000000..085463a738 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/serialization.js.map new file mode 100644 index 0000000000..4be6f7733a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts new file mode 100644 index 0000000000..00b74faf2a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.d.ts @@ -0,0 +1,7 @@ +import { type Entity, type EntityName, type Task } from 'wasp/entities'; +export type _Task = WithName; +export type _Entity = _Task | never; +type WithName = E & { + _entityName: Name; +}; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js new file mode 100644 index 0000000000..bf72aeef47 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/_types/taggedEntities.js.map new file mode 100644 index 0000000000..d716981499 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.d.ts new file mode 100644 index 0000000000..223bb1b22c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js new file mode 100644 index 0000000000..6de1c8d25f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js.map new file mode 100644 index 0000000000..4b121ba37d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts new file mode 100644 index 0000000000..dd6a8777b4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts @@ -0,0 +1,3 @@ +import Prisma from '@prisma/client'; +declare const dbClient: Prisma.PrismaClient; +export default dbClient; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.js new file mode 100644 index 0000000000..f5539f100c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.js @@ -0,0 +1,8 @@ +import Prisma from '@prisma/client'; +function createDbClient() { + return new Prisma.PrismaClient(); +} +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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.js.map new file mode 100644 index 0000000000..09af426ff3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dbClient.js","sourceRoot":"","sources":["../../server/dbClient.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,gBAAgB,CAAA;AAEnC,SAAS,cAAc;IACrB,OAAO,IAAI,MAAM,CAAC,YAAY,EAAE,CAAA;AAClC,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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.d.ts new file mode 100644 index 0000000000..dee9613a53 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js new file mode 100644 index 0000000000..0e53e0deab --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js.map new file mode 100644 index 0000000000..b84ac1b303 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts new file mode 100644 index 0000000000..617cac8a78 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js new file mode 100644 index 0000000000..0926cba3d4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map new file mode 100644 index 0000000000..0490e6f7e3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts new file mode 100644 index 0000000000..4204eb294c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/index.d.ts @@ -0,0 +1 @@ +export * from './globalMiddleware.js'; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/index.js new file mode 100644 index 0000000000..db90d2875a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/middleware/index.js.map new file mode 100644 index 0000000000..23374314b8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/index.js.map new file mode 100644 index 0000000000..2735731598 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/types.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/actions/types.js.map new file mode 100644 index 0000000000..43367cc658 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/index.d.ts new file mode 100644 index 0000000000..ee6ed4259c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/index.js new file mode 100644 index 0000000000..dde0d8e4ae --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/index.js.map new file mode 100644 index 0000000000..3e4a082c05 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/index.js.map new file mode 100644 index 0000000000..d36dc482c2 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/types.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/operations/queries/types.js.map new file mode 100644 index 0000000000..c4eb8778e7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/types/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/types/index.d.ts new file mode 100644 index 0000000000..ce2e8cb99c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/types/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/types/index.js new file mode 100644 index 0000000000..f8a711af8c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/types/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/types/index.js.map new file mode 100644 index 0000000000..4ab1f1d596 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/utils.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/utils.d.ts new file mode 100644 index 0000000000..266b9c6fbb --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/utils.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/utils.js new file mode 100644 index 0000000000..9b2034006b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/utils.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/utils.js.map new file mode 100644 index 0000000000..f3af561141 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.d.ts new file mode 100644 index 0000000000..14dd465dca --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.js new file mode 100644 index 0000000000..718fd38ae4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.js.map new file mode 100644 index 0000000000..8c06b33e94 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.d.ts new file mode 100644 index 0000000000..aa893e7838 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.js new file mode 100644 index 0000000000..988c0a67aa --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.js.map new file mode 100644 index 0000000000..a7bad96020 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/validators.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/validators.d.ts new file mode 100644 index 0000000000..bd179246a1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/validators.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/validators.js new file mode 100644 index 0000000000..53462b3932 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/validators.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/validators.js.map new file mode 100644 index 0000000000..313c98cef4 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/server/src/entities/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/entities/index.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/entities/index.ts rename to waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/entities/index.ts diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/ext-src/Main.css b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/ext-src/Main.css similarity index 100% rename from waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/ext-src/Main.css rename to waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/ext-src/Main.css diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/ext-src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/ext-src/MainPage.jsx new file mode 100644 index 0000000000..01aae7c3db --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/ext-src/waspLogo.png b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/ext-src/waspLogo.png similarity index 100% rename from waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/ext-src/waspLogo.png rename to waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/ext-src/waspLogo.png diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/package.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/package.json new file mode 100644 index 0000000000..5e4e77b7ce --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/package.json @@ -0,0 +1,101 @@ +{ + "dependencies": { + "@prisma/client": "4.16.2", + "@tanstack/react-query": "^4.29.0", + "@testing-library/jest-dom": "^6.3.0", + "@testing-library/react": "^14.1.2", + "@types/express-serve-static-core": "^4.17.13", + "@vitest/ui": "^1.2.1", + "axios": "^1.4.0", + "express": "~4.18.1", + "jsdom": "^21.1.1", + "jsonwebtoken": "^8.5.1", + "lodash.merge": "^4.6.2", + "mitt": "3.0.0", + "msw": "^1.1.0", + "prisma": "4.16.2", + "react": "^18.2.0", + "react-hook-form": "^7.45.4", + "react-router-dom": "^5.3.3", + "secure-password": "^4.0.0", + "sodium-native": "3.3.0", + "superjson": "^1.12.2", + "uuid": "^9.0.0", + "vitest": "^1.2.1" + }, + "devDependencies": { + "@tsconfig/node18": "latest" + }, + "exports": { + "./api/events": "./dist/api/events.js", + "./auth": "./dist/auth/index.js", + "./auth/helpers/user": "./dist/auth/helpers/user.js", + "./auth/jwt": "./dist/auth/jwt.js", + "./auth/pages/createAuthRequiredPage": "./dist/auth/pages/createAuthRequiredPage.jsx", + "./auth/password": "./dist/auth/password.js", + "./auth/providers/types": "./dist/auth/providers/types.js", + "./auth/session": "./dist/auth/session.js", + "./auth/utils": "./dist/auth/utils.js", + "./auth/validation": "./dist/auth/validation.js", + "./client": "./dist/client/index.js", + "./client/api": "./dist/api/index.js", + "./client/auth": "./dist/client/auth/index.js", + "./client/crud": "./dist/client/crud/index.js", + "./client/operations": "./dist/client/operations/index.js", + "./client/router": "./dist/client/router/index.js", + "./client/test": "./dist/client/test/index.js", + "./client/test/*": "./dist/client/test/*.js", + "./client/webSocket": "./dist/client/webSocket/index.js", + "./client/webSocket/WebSocketProvider": "./dist/client/webSocket/WebSocketProvider.jsx", + "./core/auth": "./dist/core/auth.js", + "./core/config": "./dist/core/config.js", + "./core/stitches.config": "./dist/core/stitches.config.js", + "./core/storage": "./dist/core/storage.js", + "./dev": "./dist/dev/index.js", + "./entities": "./dist/entities/index.js", + "./ext-src/*": "./dist/ext-src/*.js", + "./operations": "./dist/operations/index.js", + "./operations/*": "./dist/operations/*", + "./server": "./dist/server/index.js", + "./server/api": "./dist/server/api/index.js", + "./server/auth": "./dist/server/auth/index.js", + "./server/auth/email": "./dist/server/auth/email/index.js", + "./server/auth/email/utils": "./dist/server/auth/email/utils.js", + "./server/crud": "./dist/server/crud/index.js", + "./server/crud/*": "./dist/server/crud/*", + "./server/email": "./dist/server/email/index.js", + "./server/email/core/types": "./dist/server/email/core/types.js", + "./server/jobs": "./dist/server/jobs/index.js", + "./server/jobs/*": "./dist/server/jobs/*.js", + "./server/jobs/core/pgBoss": "./dist/server/jobs/core/pgBoss/index.js", + "./server/middleware": "./dist/server/middleware/index.js", + "./server/opeations/actions": "./dist/server/actions/index.js", + "./server/operations": "./dist/server/operations/index.js", + "./server/operations/queries": "./dist/server/queries/index.js", + "./server/types": "./dist/server/types/index.js", + "./server/utils": "./dist/server/utils.js", + "./server/webSocket": "./dist/server/webSocket/index.js", + "./universal/types": "./dist/universal/types.js", + "./universal/url": "./dist/universal/url.js", + "./universal/validators": "./dist/universal/validators.js" + }, + "include": [ + "src/**/*" + ], + "license": "ISC", + "name": "wasp", + "private": true, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "types": "tsc --declaration --emitDeclarationOnly --stripInternal --declarationDir dist" + }, + "type": "module", + "typesVersions": { + "*": { + "client/api": [ + "api/index.ts" + ] + } + }, + "version": "1.0.0" +} diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/HttpError.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/HttpError.ts new file mode 100644 index 0000000000..3e8d3f5a0d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/HttpError.ts @@ -0,0 +1,23 @@ +export class HttpError extends Error { + public statusCode: number + public data: unknown + + constructor (statusCode: number, message?: string, data?: Record, ...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/waspMigrate-golden/waspMigrate/.wasp/out/server/src/_types/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/_types/index.ts similarity index 93% rename from waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/_types/index.ts rename to waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/_types/index.ts index c2e4b2dcb7..f24745146a 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/_types/index.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/_types/index.ts @@ -1,7 +1,7 @@ -import { type Expand } from "../universal/types.js"; +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 "../dbClient.js" +import { prisma } from 'wasp/server' import { type _Entity } from "./taggedEntities" import { type Payload } from "./serialization"; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/_types/serialization.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/_types/serialization.ts new file mode 100644 index 0000000000..c8ff9c1ae3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/server/src/_types/taggedEntities.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts similarity index 95% rename from waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/_types/taggedEntities.ts rename to waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts index 2c8ee31042..67be1c47db 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/_types/taggedEntities.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts @@ -7,7 +7,7 @@ import { type Entity, type EntityName, type Task, -} from '../entities' +} from 'wasp/entities' export type _Task = WithName diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/config.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/config.ts new file mode 100644 index 0000000000..07c90ee26b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/dbClient.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/dbClient.ts new file mode 100644 index 0000000000..29400dd127 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/dbClient.ts @@ -0,0 +1,10 @@ +import Prisma from '@prisma/client' + +function createDbClient(): Prisma.PrismaClient { + return new Prisma.PrismaClient() +} + +const dbClient = createDbClient() + +// PUBLIC API +export default dbClient diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/index.ts new file mode 100644 index 0000000000..535077900b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts new file mode 100644 index 0000000000..8bab5e4709 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/middleware/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/middleware/index.ts new file mode 100644 index 0000000000..50996ec27d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/middleware/index.ts @@ -0,0 +1 @@ +export * from './globalMiddleware.js' diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/operations/actions/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/operations/actions/index.ts new file mode 100644 index 0000000000..78b2ff0a44 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/operations/actions/index.ts @@ -0,0 +1,2 @@ +import { prisma } from 'wasp/server' + diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/operations/actions/types.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/operations/actions/types.ts new file mode 100644 index 0000000000..183065b864 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/operations/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/operations/index.ts new file mode 100644 index 0000000000..5d50ecb37b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/operations/queries/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/operations/queries/index.ts new file mode 100644 index 0000000000..78b2ff0a44 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/operations/queries/index.ts @@ -0,0 +1,2 @@ +import { prisma } from 'wasp/server' + diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/operations/queries/types.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/operations/queries/types.ts new file mode 100644 index 0000000000..a156fb294a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/types/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/types/index.ts new file mode 100644 index 0000000000..1bbffc7555 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/utils.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/utils.ts new file mode 100644 index 0000000000..c8cc823348 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/tsconfig.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/tsconfig.json new file mode 100644 index 0000000000..a7030c61d5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/universal/types.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/types.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/universal/types.ts rename to waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/types.ts diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/universal/url.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/url.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/universal/url.ts rename to waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/url.ts diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/validators.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/validators.ts new file mode 100644 index 0000000000..3d30d9622a --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/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/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/nodemon.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/nodemon.json index 9ac8c1df77..01fe71701a 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/nodemon.json +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/nodemon.json @@ -4,7 +4,9 @@ }, "watch": [ "src/", + "../../../src/", ".env" ], + "comment-filip": "We now have to watch ../../../src/ because we're importing client files directly", "ext": "ts,mts,js,mjs,json" } diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/package.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/package.json index bb2a7149f4..c06ac995ff 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/package.json +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/package.json @@ -1,19 +1,16 @@ { + "comment-filip": "The server.js location changed because we have now included client source files above .wasp/out/server/src.", "dependencies": { - "@prisma/client": "4.16.2", "cookie-parser": "~1.4.6", "cors": "^2.8.5", "dotenv": "16.0.2", "express": "~4.18.1", "helmet": "^6.0.0", "jsonwebtoken": "^8.5.1", - "lodash.merge": "^4.6.2", "morgan": "~1.10.0", - "patch-package": "^6.4.7", "rate-limiter-flexible": "^2.4.1", "secure-password": "^4.0.0", - "superjson": "^1.12.2", - "uuid": "^9.0.0" + "superjson": "^1.12.2" }, "devDependencies": { "@tsconfig/node18": "latest", @@ -21,38 +18,32 @@ "@types/express": "^4.17.13", "@types/express-serve-static-core": "^4.17.13", "@types/node": "^18.0.0", - "@types/uuid": "^9.0.0", "nodemon": "^2.0.19", - "prisma": "4.16.2", - "standard": "^17.0.0", - "typescript": "^5.1.0" + "rollup": "^4.9.6", + "rollup-plugin-esbuild": "^6.1.1", + "standard": "^17.0.0" }, "engineStrict": true, "engines": { - "node": ">=18.0.0" + "node": ">=18.18.0" }, "name": "server", "nodemonConfig": { "delay": "1000" }, - "overrides": { - "secure-password": { - "sodium-native": "3.3.0" - } - }, + "overrides": {}, "prisma": {}, "private": true, "scripts": { - "build": "npx tsc", - "build-and-start": "npm run build && npm run start", + "bundle": "rollup --config --silent", + "bundle-and-start": "npm run bundle && npm run start", "db-migrate-prod": "prisma migrate deploy --schema=../db/schema.prisma", - "db-seed": "npm run build && NODE_PATH=dist node -r dotenv/config dist/dbSeed.js", - "postinstall": "patch-package", + "db-seed": "npm run bundle && node --enable-source-maps -r dotenv/config bundle/dbSeed.js", "standard": "standard", - "start": "npm run validate-env && NODE_PATH=dist node -r dotenv/config dist/server.js", + "start": "npm run validate-env && node --enable-source-maps -r dotenv/config bundle/server.js", "start-production": "npm run db-migrate-prod && NODE_ENV=production npm run start", "validate-env": "node -r dotenv/config ./scripts/validate-env.mjs", - "watch": "nodemon --exec 'npm run build-and-start || exit 1'" + "watch": "nodemon --exec 'npm run bundle-and-start || exit 1'" }, "type": "module", "version": "0.0.0" diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/rollup.config.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/rollup.config.js new file mode 100644 index 0000000000..9f0b986fb9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/rollup.config.js @@ -0,0 +1,24 @@ +import esbuild from 'rollup-plugin-esbuild' + +export default [ + createBundle('src/server.ts', 'bundle/server.js'), +] + +function createBundle(inputFilePath, outputFilePath) { + return { + input: inputFilePath, + output: { + file: outputFilePath, + format: 'es', + sourcemap: true, + }, + plugins: [ + esbuild({ + target: 'esnext', + }), + ], + // We don't want to bundle any of the node_module deps + // as we want to keep them as external dependencies + external: (id) => !/^[./]/.test(id), + } +} diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/scripts/universal/validators.mjs b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/scripts/universal/validators.mjs deleted file mode 100644 index 9e3605d3b5..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/scripts/universal/validators.mjs +++ /dev/null @@ -1,21 +0,0 @@ -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`); - } -} diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/scripts/validate-env.mjs index fb68580bbb..ac264b7961 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/scripts/validate-env.mjs +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/scripts/validate-env.mjs @@ -1,4 +1,4 @@ -import { throwIfNotValidAbsoluteURL } from './universal/validators.mjs'; +import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; console.info("🔍 Validating environment variables..."); throwIfNotValidAbsoluteURL(process.env.WASP_WEB_CLIENT_URL, 'Environment variable WASP_WEB_CLIENT_URL'); diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/_types/serialization.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/_types/serialization.ts deleted file mode 100644 index 595b5ba69f..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/_types/serialization.ts +++ /dev/null @@ -1,43 +0,0 @@ -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 - -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/waspMigrate-golden/waspMigrate/.wasp/out/server/src/actions/types.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/actions/types.ts index b5fa48def7..183065b864 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/actions/types.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/actions/types.ts @@ -1,4 +1,4 @@ import { type Payload, -} from '../_types' +} from 'wasp/server/_types' diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/app.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/app.js index a15cb96cea..025a3c4c14 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/app.js +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/app.js @@ -1,6 +1,6 @@ import express from 'express' -import HttpError from './core/HttpError.js' +import { HttpError } from 'wasp/server' import indexRouter from './routes/index.js' // TODO: Consider extracting most of this logic into createApp(routes, path) function so that diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/config.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/config.js deleted file mode 100644 index 35ba136633..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/config.js +++ /dev/null @@ -1,42 +0,0 @@ -import merge from 'lodash.merge' - -import { stripTrailingSlash } from "./universal/url.js"; - -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 - -const config = { - all: { - env, - isDevelopment: env === 'development', - port: parseInt(process.env.PORT) || 3001, - databaseUrl: process.env.DATABASE_URL, - frontendUrl: undefined, - allowedCORSOrigins: [], - }, - development: getDevelopmentConfig(), - production: getProductionConfig(), -} - -const resolvedConfig = merge(config.all, config[env]) -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], - } -} diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/core/AuthError.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/core/AuthError.js deleted file mode 100644 index 2d965c168e..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/core/AuthError.js +++ /dev/null @@ -1,17 +0,0 @@ -class AuthError extends Error { - constructor (message, data, ...params) { - super(message, ...params) - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, AuthError) - } - - this.name = this.constructor.name - - if (data) { - this.data = data - } - } -} - -export default AuthError diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/core/HttpError.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/core/HttpError.js deleted file mode 100644 index 8a2cb04db5..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/core/HttpError.js +++ /dev/null @@ -1,22 +0,0 @@ -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 - } - } -} - -export default HttpError diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/dbClient.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/dbClient.ts deleted file mode 100644 index 66e7801be3..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/dbClient.ts +++ /dev/null @@ -1,12 +0,0 @@ -import Prisma from '@prisma/client' - - -const createDbClient = () => { - const prismaClient = new Prisma.PrismaClient() - - return prismaClient -} - -const dbClient = createDbClient() - -export default dbClient diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/dbSeed/types.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/dbSeed/types.ts deleted file mode 100644 index fe0d5396a4..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/dbSeed/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { PrismaClient } from '@prisma/client' - -export type DbSeedFn = (prismaClient: PrismaClient) => Promise diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/middleware/globalMiddleware.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/middleware/globalMiddleware.ts index 2eca3e9f74..ce46c57ead 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/middleware/globalMiddleware.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/middleware/globalMiddleware.ts @@ -4,14 +4,12 @@ import logger from 'morgan' import cors from 'cors' import helmet from 'helmet' -import config from '../config.js' +import { config } from 'wasp/server' +import type { MiddlewareConfig, MiddlewareConfigFn } from 'wasp/server/middleware' +export type { MiddlewareConfig, MiddlewareConfigFn } from 'wasp/server/middleware' const _waspGlobalMiddlewareConfigFn = (mc: MiddlewareConfig) => mc -export type MiddlewareConfig = Map - -export type MiddlewareConfigFn = (middlewareConfig: MiddlewareConfig) => MiddlewareConfig - // This is the set of middleware Wasp supplies by default. // NOTE: Remember to update the docs of these change. const defaultGlobalMiddlewareConfig: MiddlewareConfig = new Map([ diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/middleware/operations.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/middleware/operations.ts index cea765236b..a86f8a8157 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/middleware/operations.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/middleware/operations.ts @@ -2,7 +2,7 @@ import { deserialize as superjsonDeserialize, serialize as superjsonSerialize, } from 'superjson' -import { handleRejection } from '../utils.js' +import { handleRejection } from 'wasp/server/utils' export function createOperation (handlerFn) { return handleRejection(async (req, res) => { diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/queries/types.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/queries/types.ts index 8024d29f08..a156fb294a 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/queries/types.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/queries/types.ts @@ -1,5 +1,5 @@ import { type Payload, -} from '../_types' +} from 'wasp/server/_types' diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/server.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/server.ts index fff57f199b..b8b7e0c0b3 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/server.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/server.ts @@ -1,7 +1,7 @@ import http from 'http' import app from './app.js' -import config from './config.js' +import { config } from 'wasp/server' diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/types/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/types/index.ts deleted file mode 100644 index b30c92f5ec..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/types/index.ts +++ /dev/null @@ -1,14 +0,0 @@ - -import { type Application } from 'express' -import { Server } from 'http' - -export type ServerSetupFn = (context: ServerSetupFnContext) => Promise - -export type ServerSetupFnContext = { - app: Application, - server: Server, -} - -export type { Application } from 'express' -export type { Server } from 'http' - diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/universal/types.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/universal/types.ts deleted file mode 100644 index 8cadbd740d..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/universal/types.ts +++ /dev/null @@ -1,31 +0,0 @@ -// 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/waspMigrate-golden/waspMigrate/.wasp/out/server/src/universal/url.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/universal/url.ts deleted file mode 100644 index d21c06c65c..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/universal/url.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function stripTrailingSlash(url?: string): string | undefined { - return url?.replace(/\/$/, ""); -} diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/tsconfig.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/tsconfig.json index f0ce78775e..68d7a47b0d 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/tsconfig.json +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/tsconfig.json @@ -2,7 +2,33 @@ "extends": "@tsconfig/node18/tsconfig.json", "compilerOptions": { // Overriding this until we implement more complete TypeScript support. + // Filip: begin client file hacks + // We need this to make server work with copied client files (we copy everything) + "jsx": "preserve", + "lib": [ + "esnext", + "dom", + "DOM.Iterable" + ], + // Filip: end client file hacks "strict": false, + // When left unspecified, the 'rootDir' defaults to the longest common path of + // all non-declaration input files. TypeScript mimics the source structure + // inside the output directory (i.e., 'dist'). + // + // Since Wasp apps can (but don't have to) import user files from + // '../../../src', it makes the rootDir's default value inconsistent: + // - When the app doesn't import user files (e.g., the user didn't specify + // any operations), the rootDir is set to the server source dir (/src). + // - When the app imports user files (as is the case for most Wasp apps), + // the rootDir is set to the Wasp project root (../../../). + // + // Our build script (in package.json) requires a consistent structure of + // the output directory, which is why we always make sure to point the rootDir + // to the Wasp project root (../../../). + // + // See this comment for more details: https://github.com/wasp-lang/wasp/pull/1584#discussion_r1404019301 + "rootDir": "../../../", // Overriding this because we want to use top-level await "module": "esnext", "target": "es2017", @@ -10,12 +36,13 @@ "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 }, - "include": ["src"] -} + "include": [ + "src" + ] +} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/package.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/package.json index f82d64608a..b21fe30bf4 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/package.json +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/package.json @@ -12,35 +12,24 @@ ] }, "dependencies": { - "@prisma/client": "4.16.2", "@tanstack/react-query": "^4.29.0", "axios": "^1.4.0", "mitt": "3.0.0", - "react": "^18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.45.4", "react-router-dom": "^5.3.3", "superjson": "^1.12.2" }, "devDependencies": { - "@testing-library/jest-dom": "^5.16.5", - "@testing-library/react": "^14.0.0", "@tsconfig/vite-react": "^2.0.0", - "@types/react": "^18.0.37", "@types/react-dom": "^18.0.11", "@types/react-router-dom": "^5.3.3", - "@vitejs/plugin-react-swc": "^3.0.0", - "@vitest/ui": "^0.29.3", - "dotenv": "^16.0.3", - "jsdom": "^21.1.1", - "msw": "^1.1.0", - "typescript": "^5.1.0", - "vite": "^4.3.9", - "vitest": "^0.29.3" + "@vitejs/plugin-react": "^4.2.1", + "dotenv": "^16.0.3" }, "engineStrict": true, "engines": { - "node": ">=18.0.0" + "node": ">=18.18.0" }, "name": "waspMigrate", "private": true, diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/public/.gitkeep b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/public/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/scripts/universal/validators.mjs b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/scripts/universal/validators.mjs deleted file mode 100644 index 9e3605d3b5..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/scripts/universal/validators.mjs +++ /dev/null @@ -1,21 +0,0 @@ -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`); - } -} diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/scripts/validate-env.mjs index 27d6a9fd59..18ee507c9e 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/scripts/validate-env.mjs +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/scripts/validate-env.mjs @@ -1,4 +1,4 @@ -import { throwIfNotValidAbsoluteURL } from './universal/validators.mjs'; +import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; console.info("🔍 Validating environment variables..."); throwIfNotValidAbsoluteURL(process.env.REACT_APP_API_URL, 'Environemnt variable REACT_APP_API_URL'); diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/actions/core.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/actions/core.d.ts deleted file mode 100644 index fa31f329ff..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/actions/core.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { type Action } from '.' -import type { Expand, _Awaited, _ReturnType } from '../universal/types' - -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/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/actions/core.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/actions/core.js deleted file mode 100644 index 440e906140..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/actions/core.js +++ /dev/null @@ -1,35 +0,0 @@ -import { callOperation, makeOperationRoute } from '../operations' -import { - registerActionInProgress, - registerActionDone, -} from '../operations/resources' - -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/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/actions/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/actions/index.ts deleted file mode 100644 index 7fb2de2f9e..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/actions/index.ts +++ /dev/null @@ -1,269 +0,0 @@ -import { - QueryClient, - QueryKey, - useMutation, - UseMutationOptions, - useQueryClient, -} from '@tanstack/react-query' -import { type Query } from '../queries'; - -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/data-model/operations/actions#the-useaction-hook-and-optimistic-updates - */ -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 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/data-model/operations/actions#the-useaction-hook-and-optimistic-updates - * @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[] -): 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[] -): 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, - 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/data-model/operations/actions#the-useaction-hook-and-optimistic-updates - * @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/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/api.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/api.ts deleted file mode 100644 index 17e36c1248..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/api.ts +++ /dev/null @@ -1,104 +0,0 @@ -import axios, { type AxiosError } from 'axios' - -import config from './config' -import { storage } from './storage' -import { apiEventsEmitter } from './api/events' - -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 - -export function setSessionId(sessionId: string): void { - waspAppAuthSessionId = sessionId - storage.set(WASP_APP_AUTH_SESSION_ID_NAME, sessionId) - apiEventsEmitter.emit('sessionId.set') -} - -export function getSessionId(): string | undefined { - return waspAppAuthSessionId -} - -export function clearSessionId(): void { - waspAppAuthSessionId = undefined - storage.remove(WASP_APP_AUTH_SESSION_ID_NAME) - apiEventsEmitter.emit('sessionId.clear') -} - -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') - } - } -}) - -/** - * 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 - } -} - -export default api diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/config.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/config.js deleted file mode 100644 index c5d18dfed1..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/config.js +++ /dev/null @@ -1,9 +0,0 @@ -import { stripTrailingSlash } from "./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/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/ext-src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/ext-src/MainPage.jsx deleted file mode 100644 index c53ad8abaa..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/ext-src/MainPage.jsx +++ /dev/null @@ -1,40 +0,0 @@ -import waspLogo from './waspLogo.png' -import './Main.css' - -const 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. -

- - -
-
- ) -} -export default MainPage diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/ext-src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/ext-src/vite-env.d.ts deleted file mode 100644 index 1623b9c79c..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/ext-src/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/ext-src/vite.config.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/ext-src/vite.config.ts deleted file mode 100644 index a55924e2b6..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/ext-src/vite.config.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { defineConfig } from 'vite' - -export default defineConfig({ - server: { - open: true, - }, -}) diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/index.tsx b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/index.tsx index 17d6749e4a..0b7f1d9854 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/index.tsx +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/index.tsx @@ -6,7 +6,7 @@ import router from './router' import { initializeQueryClient, queryClientInitialized, -} from './queryClient' +} from 'wasp/client/operations' diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/operations/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/operations/index.ts deleted file mode 100644 index 2d4494b050..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/operations/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -import api, { handleApiError } from '../api' -import { HttpMethod } from '../types' -import { - serialize as superjsonSerialize, - deserialize as superjsonDeserialize, - } from 'superjson' - -export type OperationRoute = { method: HttpMethod, path: string } - -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) - } -} - -export function makeOperationRoute(relativeOperationRoute: string): OperationRoute { - return { method: HttpMethod.Post, path: `/${relativeOperationRoute}` } -} diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/operations/resources.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/operations/resources.js deleted file mode 100644 index 779cd55a5f..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/operations/resources.js +++ /dev/null @@ -1,81 +0,0 @@ -import { queryClientInitialized } from '../queryClient' -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) -/** - * 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/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/queries/core.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/queries/core.d.ts deleted file mode 100644 index e1bdbe4783..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/queries/core.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { type Query } from '.' -import { Route } from '../types'; -import type { Expand, _Awaited, _ReturnType } from '../universal/types' - -export function createQuery( - queryRoute: string, - entitiesUsed: any[] -): QueryFor - -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/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/queries/core.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/queries/core.js deleted file mode 100644 index 5103db1d8b..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/queries/core.js +++ /dev/null @@ -1,27 +0,0 @@ -import { callOperation, makeOperationRoute } from '../operations' -import { - addResourcesUsedByQuery, - getActiveOptimisticUpdates, -} from '../operations/resources' - -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 -} - -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/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/queries/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/queries/index.d.ts deleted file mode 100644 index c007ff4c92..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/queries/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { UseQueryResult } from "@tanstack/react-query"; - -export type Query = { - (queryCacheKey: string[], args: Input): Promise -} - -export function useQuery( - queryFn: Query, - queryFnArgs?: Input, options?: any -): UseQueryResult diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/queries/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/queries/index.js deleted file mode 100644 index 03e52ce0f9..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/queries/index.js +++ /dev/null @@ -1,18 +0,0 @@ -import { useQuery as rqUseQuery } from '@tanstack/react-query' -export { configureQueryClient } from '../queryClient' - -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 - }) -} diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router.tsx b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router.tsx index a18069e2e3..b5ca2c4620 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router.tsx +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router.tsx @@ -1,27 +1,15 @@ import React from 'react' import { Route, Switch, BrowserRouter as Router } from 'react-router-dom' -import { interpolatePath } from './router/linkHelpers' -import type { - RouteDefinitionsToRoutes, - OptionalRouteOptions, - ParamValue, -} from './router/types' -import MainPage from './ext-src/MainPage.jsx' +import { MainPage } from '../../../../src/MainPage.jsx' -export const routes = { - RootRoute: { - to: "/", - component: MainPage, - build: ( - options?: OptionalRouteOptions, - ) => interpolatePath("/", undefined, options.search, options.hash), - }, -} as const; +import { routes } from 'wasp/client/router' -export type Routes = RouteDefinitionsToRoutes +export const routeNameToRouteComponent = { + RootRoute: MainPage, +} as const; const router = ( @@ -31,7 +19,7 @@ const router = ( exact key={routeKey} path={route.to} - component={route.component} + component={routeNameToRouteComponent[routeKey]} /> ))} @@ -39,5 +27,3 @@ const router = ( ) export default router - -export { Link } from './router/Link' diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router/Link.tsx b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router/Link.tsx deleted file mode 100644 index df29edb857..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router/Link.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { useMemo } from 'react' -import { Link as RouterLink } from 'react-router-dom' -import { type Routes } from '../router' -import { interpolatePath } from './linkHelpers' - -type RouterLinkProps = Parameters[0] - -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/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router/linkHelpers.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router/linkHelpers.ts deleted file mode 100644 index 291d8238a3..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router/linkHelpers.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { Params, Search } from "./types"; - -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/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router/types.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router/types.ts deleted file mode 100644 index 0688d0bbba..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/router/types.ts +++ /dev/null @@ -1,36 +0,0 @@ -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 } diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/test/vitest/helpers.tsx b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/test/vitest/helpers.tsx deleted file mode 100644 index 4152191129..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/test/vitest/helpers.tsx +++ /dev/null @@ -1,93 +0,0 @@ -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 '../../queries' -import config from '../../config' -import { HttpMethod, Route } from '../../types' - -export type { Route } from '../../types' - -export type MockQuery = ( - query: Query, - resJson: MockOutput -) => void - -export type MockApi = (route: Route, resJson: unknown) => void - -// 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} - - ), - } -} - -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/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/test/vitest/setup.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/test/vitest/setup.ts index d263e51f4f..f62fc46590 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/test/vitest/setup.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/test/vitest/setup.ts @@ -1,4 +1,8 @@ -import matchers from '@testing-library/jest-dom/matchers' -import { expect } from 'vitest' +import { afterEach } from 'vitest' +import { cleanup } from '@testing-library/react' +import '@testing-library/jest-dom/vitest' -expect.extend(matchers) +// runs a clean after each test case (e.g. clearing jsdom) +afterEach(() => { + cleanup(); +}) diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/types.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/types.ts deleted file mode 100644 index 982b766e37..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -// 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', -} - -export type Route = { method: HttpMethod; path: string } diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/universal/types.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/universal/types.ts deleted file mode 100644 index 8cadbd740d..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/universal/types.ts +++ /dev/null @@ -1,31 +0,0 @@ -// 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/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/universal/url.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/universal/url.ts deleted file mode 100644 index d21c06c65c..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/universal/url.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function stripTrailingSlash(url?: string): string | undefined { - return url?.replace(/\/$/, ""); -} diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/tsconfig.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/tsconfig.json index 968a1bb47f..4e7d14e1cd 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/tsconfig.json +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/tsconfig.json @@ -6,8 +6,14 @@ "allowJs": true, "strict": false, // Allow importing pages with the .tsx extension. - "allowImportingTsExtensions": true + "allowImportingTsExtensions": true, }, - "include": ["src"], - "references": [{ "path": "./tsconfig.node.json" }] -} + "include": [ + "src" + ], + "references": [ + { + "path": "./tsconfig.node.json" + } + ] +} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/vite.config.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/vite.config.ts index 0bc670f493..ed2d3dd5f0 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/vite.config.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/vite.config.ts @@ -1,13 +1,19 @@ /// import { mergeConfig } from "vite"; -import react from "@vitejs/plugin-react-swc"; +import react from "@vitejs/plugin-react"; +import { defaultExclude } from "vitest/config" -import customViteConfig from './src/ext-src/vite.config' +// Ignoring the TS error because we are importing a file outside of TS root dir. +// @ts-ignore +import customViteConfig from '../../../vite.config' const _waspUserProvidedConfig = customViteConfig const defaultViteConfig = { base: "/", plugins: [react()], + optimizeDeps: { + exclude: ['wasp'] + }, server: { port: 3000, host: "0.0.0.0", @@ -17,9 +23,22 @@ const defaultViteConfig = { build: { outDir: "build", }, + resolve: { + // These packages rely on a single instance per page. Not dedpuing them + // causes runtime errors (e.g., hook rule violation in react, QueryClient + // instance error in react-query, Invariant Error in react-router-dom). + dedupe: ["react", "react-dom", "@tanstack/react-query", "react-router-dom"] + }, test: { + globals: true, environment: "jsdom", - setupFiles: ["./src/test/vitest/setup.ts"], + // Since Vitest is running from the root of the project, we need + // to specify the path to the setup file relative to the root. + setupFiles: ['.wasp/out/web-app/src/test/vitest/setup.ts'], + exclude: [ + ...defaultExclude, + ".wasp/**/*", + ] }, }; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/.waspignore b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.waspignore similarity index 100% rename from waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/.waspignore rename to waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.waspignore diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/main.wasp b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/main.wasp index cc45a9633e..ed3898ecbf 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/main.wasp +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/main.wasp @@ -7,7 +7,7 @@ app waspMigrate { route RootRoute { path: "/", to: MainPage } page MainPage { - component: import Main from "@client/MainPage.jsx" + component: import { MainPage } from "@src/MainPage.jsx" } entity Task {=psl id Int @id @default(autoincrement()) diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/package.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/package.json new file mode 100644 index 0000000000..28c6ab3ec5 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/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": "waspMigrate" +} diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/public/.gitkeep b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/public/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/Main.css b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/Main.css similarity index 100% rename from waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/Main.css rename to waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/Main.css diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/MainPage.jsx new file mode 100644 index 0000000000..01aae7c3db --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/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/waspMigrate-golden/waspMigrate/src/client/MainPage.jsx b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/MainPage.jsx deleted file mode 100644 index c53ad8abaa..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/MainPage.jsx +++ /dev/null @@ -1,40 +0,0 @@ -import waspLogo from './waspLogo.png' -import './Main.css' - -const 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. -

- - -
-
- ) -} -export default MainPage diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/tsconfig.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/tsconfig.json deleted file mode 100644 index d501a4193a..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/tsconfig.json +++ /dev/null @@ -1,55 +0,0 @@ -// =============================== IMPORTANT ================================= -// -// This file is only used for Wasp IDE support. You can change it to configure -// your IDE checks, but none of these options will affect the TypeScript -// compiler. Proper TS compiler configuration in Wasp is coming soon :) -{ - "compilerOptions": { - // JSX support - "jsx": "preserve", - "strict": true, - // Allow default imports. - "esModuleInterop": true, - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - // Wasp needs the following settings enable IDE support in your source - // files. Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/web-app/", - "paths": { - // Resolve all "@wasp" imports to the generated source code. - "@wasp/*": [ - "src/*" - ], - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": [ - "../../.wasp/out/web-app/node_modules/@types" - ], - // Since this TS config is used only for IDE support and not for - // compilation, the following directory doesn't exist. We need to specify - // it to prevent this error: - // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file - "outDir": "phantom" - }, - "exclude": [ - "phantom" - ], -} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/vite-env.d.ts deleted file mode 100644 index 1623b9c79c..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/vite.config.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/vite.config.ts deleted file mode 100644 index a55924e2b6..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/vite.config.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { defineConfig } from 'vite' - -export default defineConfig({ - server: { - open: true, - }, -}) diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/server/tsconfig.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/server/tsconfig.json deleted file mode 100644 index 70a79b44ee..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/server/tsconfig.json +++ /dev/null @@ -1,48 +0,0 @@ -// =============================== IMPORTANT ================================= -// -// This file is only used for Wasp IDE support. You can change it to configure -// your IDE checks, but none of these options will affect the TypeScript -// compiler. Proper TS compiler configuration in Wasp is coming soon :) -{ - "compilerOptions": { - // Allows default imports. - "esModuleInterop": true, - "allowJs": true, - "strict": true, - // Wasp needs the following settings enable IDE support in your source - // files. Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/server/", - "paths": { - // Resolve all "@wasp" imports to the generated source code. - "@wasp/*": [ - "src/*" - ], - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": [ - "../../.wasp/out/server/node_modules/@types" - ], - // Since this TS config is used only for IDE support and not for - // compilation, the following directory doesn't exist. We need to specify - // it to prevent this error: - // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file - "outDir": "phantom", - }, - "exclude": [ - "phantom" - ], -} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/shared/tsconfig.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/shared/tsconfig.json deleted file mode 100644 index 20fcac8431..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/shared/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - // Enable default imports in TypeScript. - "esModuleInterop": true, - "allowJs": true, - // The following settings enable IDE support in user-provided source files. - // Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/server/", - "paths": { - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": ["../../.wasp/out/server/node_modules/@types"] - } -} diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/waspLogo.png b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/waspLogo.png similarity index 100% rename from waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/client/waspLogo.png rename to waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/src/waspLogo.png diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/tsconfig.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/tsconfig.json new file mode 100644 index 0000000000..a05fb4efd3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/tsconfig.json @@ -0,0 +1,34 @@ +// =============================== IMPORTANT ================================= +// +// This file is only used for Wasp IDE support. You can change it to configure +// your IDE checks, but none of these options will affect the TypeScript +// compiler. Proper TS compiler configuration in Wasp is coming soon :) +{ + "compilerOptions": { + // JSX support + "jsx": "preserve", + "strict": true, + // Allow default imports. + "esModuleInterop": true, + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "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" + ], + // Since this TS config is used only for IDE support and not for + // compilation, the following directory doesn't exist. We need to specify + // it to prevent this error: + // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file + "outDir": "phantom", + }, + "exclude": [ + "phantom" + ], +} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/vite.config.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/vite.config.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/ext-src/vite.config.ts rename to waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/vite.config.ts diff --git a/waspc/e2e-test/test-outputs/waspNew-golden/files.manifest b/waspc/e2e-test/test-outputs/waspNew-golden/files.manifest index c54010eed3..5c7d2cb04b 100644 --- a/waspc/e2e-test/test-outputs/waspNew-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspNew-golden/files.manifest @@ -1,11 +1,11 @@ +waspNew/.waspignore waspNew/.wasproot waspNew/main.wasp -waspNew/src/.waspignore -waspNew/src/client/Main.css -waspNew/src/client/MainPage.jsx -waspNew/src/client/tsconfig.json -waspNew/src/client/vite-env.d.ts -waspNew/src/client/vite.config.ts -waspNew/src/client/waspLogo.png -waspNew/src/server/tsconfig.json -waspNew/src/shared/tsconfig.json +waspNew/package.json +waspNew/public/.gitkeep +waspNew/src/Main.css +waspNew/src/MainPage.jsx +waspNew/src/vite-env.d.ts +waspNew/src/waspLogo.png +waspNew/tsconfig.json +waspNew/vite.config.ts diff --git a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/.waspignore b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/.waspignore similarity index 100% rename from waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/.waspignore rename to waspc/e2e-test/test-outputs/waspNew-golden/waspNew/.waspignore diff --git a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/main.wasp b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/main.wasp index db5c502f0f..9daf0b1dc1 100644 --- a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/main.wasp +++ b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/main.wasp @@ -7,5 +7,5 @@ app waspNew { route RootRoute { path: "/", to: MainPage } page MainPage { - component: import Main from "@client/MainPage.jsx" + component: import { MainPage } from "@src/MainPage.jsx" } diff --git a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/package.json b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/package.json new file mode 100644 index 0000000000..ee5cad0c32 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/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": "waspNew" +} diff --git a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/public/.gitkeep b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/public/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/Main.css b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/Main.css similarity index 100% rename from waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/Main.css rename to waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/Main.css diff --git a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/MainPage.jsx b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/MainPage.jsx new file mode 100644 index 0000000000..01aae7c3db --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/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/waspNew-golden/waspNew/src/client/MainPage.jsx b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/MainPage.jsx deleted file mode 100644 index c53ad8abaa..0000000000 --- a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/MainPage.jsx +++ /dev/null @@ -1,40 +0,0 @@ -import waspLogo from './waspLogo.png' -import './Main.css' - -const 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. -

- - -
-
- ) -} -export default MainPage diff --git a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/tsconfig.json b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/tsconfig.json deleted file mode 100644 index d501a4193a..0000000000 --- a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/tsconfig.json +++ /dev/null @@ -1,55 +0,0 @@ -// =============================== IMPORTANT ================================= -// -// This file is only used for Wasp IDE support. You can change it to configure -// your IDE checks, but none of these options will affect the TypeScript -// compiler. Proper TS compiler configuration in Wasp is coming soon :) -{ - "compilerOptions": { - // JSX support - "jsx": "preserve", - "strict": true, - // Allow default imports. - "esModuleInterop": true, - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - // Wasp needs the following settings enable IDE support in your source - // files. Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/web-app/", - "paths": { - // Resolve all "@wasp" imports to the generated source code. - "@wasp/*": [ - "src/*" - ], - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": [ - "../../.wasp/out/web-app/node_modules/@types" - ], - // Since this TS config is used only for IDE support and not for - // compilation, the following directory doesn't exist. We need to specify - // it to prevent this error: - // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file - "outDir": "phantom" - }, - "exclude": [ - "phantom" - ], -} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/vite-env.d.ts deleted file mode 100644 index 1623b9c79c..0000000000 --- a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/vite.config.ts b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/vite.config.ts deleted file mode 100644 index a55924e2b6..0000000000 --- a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/vite.config.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { defineConfig } from 'vite' - -export default defineConfig({ - server: { - open: true, - }, -}) diff --git a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/server/tsconfig.json b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/server/tsconfig.json deleted file mode 100644 index 70a79b44ee..0000000000 --- a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/server/tsconfig.json +++ /dev/null @@ -1,48 +0,0 @@ -// =============================== IMPORTANT ================================= -// -// This file is only used for Wasp IDE support. You can change it to configure -// your IDE checks, but none of these options will affect the TypeScript -// compiler. Proper TS compiler configuration in Wasp is coming soon :) -{ - "compilerOptions": { - // Allows default imports. - "esModuleInterop": true, - "allowJs": true, - "strict": true, - // Wasp needs the following settings enable IDE support in your source - // files. Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/server/", - "paths": { - // Resolve all "@wasp" imports to the generated source code. - "@wasp/*": [ - "src/*" - ], - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": [ - "../../.wasp/out/server/node_modules/@types" - ], - // Since this TS config is used only for IDE support and not for - // compilation, the following directory doesn't exist. We need to specify - // it to prevent this error: - // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file - "outDir": "phantom", - }, - "exclude": [ - "phantom" - ], -} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/shared/tsconfig.json b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/shared/tsconfig.json deleted file mode 100644 index 20fcac8431..0000000000 --- a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/shared/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - // Enable default imports in TypeScript. - "esModuleInterop": true, - "allowJs": true, - // The following settings enable IDE support in user-provided source files. - // Editing them might break features like import autocompletion and - // definition lookup. Don't change them unless you know what you're doing. - // - // The relative path to the generated web app's root directory. This must be - // set to define the "paths" option. - "baseUrl": "../../.wasp/out/server/", - "paths": { - // Resolve all non-relative imports to the correct node module. Source: - // https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping - "*": [ - // Start by looking for the definiton inside the node modules root - // directory... - "node_modules/*", - // ... If that fails, try to find it inside definitely-typed type - // definitions. - "node_modules/@types/*" - ] - }, - // Correctly resolve types: https://www.typescriptlang.org/tsconfig#typeRoots - "typeRoots": ["../../.wasp/out/server/node_modules/@types"] - } -} diff --git a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/vite-env.d.ts b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/waspLogo.png b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/waspLogo.png similarity index 100% rename from waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/client/waspLogo.png rename to waspc/e2e-test/test-outputs/waspNew-golden/waspNew/src/waspLogo.png diff --git a/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/tsconfig.json b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/tsconfig.json new file mode 100644 index 0000000000..a05fb4efd3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/tsconfig.json @@ -0,0 +1,34 @@ +// =============================== IMPORTANT ================================= +// +// This file is only used for Wasp IDE support. You can change it to configure +// your IDE checks, but none of these options will affect the TypeScript +// compiler. Proper TS compiler configuration in Wasp is coming soon :) +{ + "compilerOptions": { + // JSX support + "jsx": "preserve", + "strict": true, + // Allow default imports. + "esModuleInterop": true, + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "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" + ], + // Since this TS config is used only for IDE support and not for + // compilation, the following directory doesn't exist. We need to specify + // it to prevent this error: + // https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file + "outDir": "phantom", + }, + "exclude": [ + "phantom" + ], +} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/client/vite.config.ts b/waspc/e2e-test/test-outputs/waspNew-golden/waspNew/vite.config.ts similarity index 100% rename from waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/src/client/vite.config.ts rename to waspc/e2e-test/test-outputs/waspNew-golden/waspNew/vite.config.ts