diff --git a/.github/workflows/waspc-ci.yaml b/.github/workflows/waspc-ci.yaml index 2d292a99b3..6528da9844 100644 --- a/.github/workflows/waspc-ci.yaml +++ b/.github/workflows/waspc-ci.yaml @@ -163,7 +163,11 @@ jobs: - name: Ensure examples/todoApp compiles and builds if: matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-latest' - run: ./examples/todoApp/ensure_app_compiles_and_builds.sh + run: ./tools/ensure_app_compiles_and_builds.sh ./examples/todoApp + + - name: Ensure examples/crud-testing compiles and builds + if: matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-latest' + run: ./tools/ensure_app_compiles_and_builds.sh ./examples/crud-testing - name: Headless - Cache Node Modules id: headless-cache-node-modules diff --git a/waspc/ChangeLog.md b/waspc/ChangeLog.md index 82f631b840..053313de63 100644 --- a/waspc/ChangeLog.md +++ b/waspc/ChangeLog.md @@ -9,6 +9,7 @@ ### 🔧 Small improvements - Show a friendlier error when there are no routes defined in the wasp file ([#2643](https://github.com/wasp-lang/wasp/pull/2643)) +- The generated server code is now type-checked before building ([#2709](https://github.com/wasp-lang/wasp/pull/2709)) ## 0.16.3 diff --git a/waspc/data/Generator/templates/sdk/wasp/server/_types/serialization.ts b/waspc/data/Generator/templates/sdk/wasp/server/_types/serialization.ts index c8ff9c1ae3..8f9565dcd0 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/_types/serialization.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/_types/serialization.ts @@ -20,8 +20,8 @@ type PrimitiveJSONValue = string | number | boolean | undefined | null export interface JSONArray extends Array {} -type SerializableJSONValue = - | Symbol +export type SerializableJSONValue = + | symbol | Set | Map | undefined @@ -30,14 +30,14 @@ type SerializableJSONValue = | RegExp // Here's where we excluded `ClassInstance` (which was `any`) from the union. -type SuperJSONValue = +export type SuperJSONValue = | JSONValue | SerializableJSONValue | SuperJSONArray | SuperJSONObject -interface SuperJSONArray extends Array {} +export interface SuperJSONArray extends Array {} -interface SuperJSONObject { +export interface SuperJSONObject { [key: string]: SuperJSONValue } diff --git a/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/provider.ts b/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/provider.ts index c02e5adbee..3f2f81e905 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/provider.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/provider.ts @@ -1,13 +1,14 @@ import { OAuth2Provider, OAuth2ProviderWithPKCE } from "arctic"; export function defineProvider< - OAuthClient extends OAuth2Provider | OAuth2ProviderWithPKCE + OAuthClient extends OAuth2Provider | OAuth2ProviderWithPKCE, + const Id extends string >({ id, displayName, oAuthClient, }: { - id: string; + id: Id; displayName: string; oAuthClient: OAuthClient; }) { diff --git a/waspc/data/Generator/templates/sdk/wasp/server/crud/_operationTypes.ts b/waspc/data/Generator/templates/sdk/wasp/server/crud/_operationTypes.ts index 19df952711..b789aa0af8 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/crud/_operationTypes.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/crud/_operationTypes.ts @@ -11,7 +11,7 @@ import type { _{= crud.entityUpper =}, } from "../_types"; import type { Prisma } from "@prisma/client"; -import type { Payload } from "../_types/serialization"; +import type { Payload, SuperJSONObject } from "../_types/serialization"; import type { {= crud.entityUpper =}, } from "wasp/entities"; @@ -37,7 +37,7 @@ type _WaspEntity = {= crud.entityUpper =} /** * PUBLIC API */ -export namespace {= crud.name =} { +export declare namespace {= crud.name =} { {=# crud.operations.GetAll =} export type GetAllQuery = {= queryType =}<[_WaspEntityTagged], Input, Output> {=/ crud.operations.GetAll =} @@ -61,7 +61,7 @@ export namespace {= crud.name =} { /** * 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. */ @@ -79,7 +79,7 @@ export type GetAllQueryResolved = typeof _waspGetAllQuery {=# crud.operations.Get =} {=^ overrides.Get.isDefined =} -type GetInput = Prisma.{= crud.entityUpper =}WhereUniqueInput +type GetInput = SuperJSONObject & Prisma.{= crud.entityUpper =}WhereUniqueInput type GetOutput = _WaspEntity | null export type GetQueryResolved = {= crud.name =}.GetQuery {=/ overrides.Get.isDefined =} @@ -91,7 +91,7 @@ export type GetQueryResolved = typeof _waspGetQuery {=# crud.operations.Create =} {=^ overrides.Create.isDefined =} -type CreateInput = Prisma.XOR< +type CreateInput = SuperJSONObject & Prisma.XOR< Prisma.{= crud.entityUpper =}CreateInput, Prisma.{= crud.entityUpper =}UncheckedCreateInput > @@ -106,7 +106,7 @@ export type CreateActionResolved = typeof _waspCreateAction {=# crud.operations.Update =} {=^ overrides.Update.isDefined =} -type UpdateInput = Prisma.XOR< +type UpdateInput = SuperJSONObject & Prisma.XOR< Prisma.{= crud.entityUpper =}UpdateInput, Prisma.{= crud.entityUpper =}UncheckedUpdateInput > @@ -123,7 +123,7 @@ export type UpdateActionResolved = typeof _waspUpdateAction {=# crud.operations.Delete =} {=^ overrides.Delete.isDefined =} -type DeleteInput = Prisma.{= crud.entityUpper =}WhereUniqueInput +type DeleteInput = SuperJSONObject & Prisma.{= crud.entityUpper =}WhereUniqueInput type DeleteOutput = _WaspEntity export type DeleteActionResolved = {= crud.name =}.DeleteAction {=/ overrides.Delete.isDefined =} diff --git a/waspc/data/Generator/templates/sdk/wasp/server/utils.ts b/waspc/data/Generator/templates/sdk/wasp/server/utils.ts index 5801efee10..b4c231b91b 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/utils.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/utils.ts @@ -19,14 +19,14 @@ type RequestWithExtraFields = Request & { * if given middleware returns promise, reject of that promise will be correctly handled, * meaning that error will be forwarded to next(). */ -export const handleRejection = ( +export const handleRejection = ( middleware: ( - req: RequestWithExtraFields, - res: Response, + req: Req, + res: Res, next: NextFunction ) => any ) => -async (req: RequestWithExtraFields, res: Response, next: NextFunction) => { +async (req: Req, res: Res, next: NextFunction) => { try { await middleware(req, res, next) } catch (error) { diff --git a/waspc/data/Generator/templates/server/package.json b/waspc/data/Generator/templates/server/package.json index 14f6464bbe..a3b4c88473 100644 --- a/waspc/data/Generator/templates/server/package.json +++ b/waspc/data/Generator/templates/server/package.json @@ -6,7 +6,7 @@ "type": "module", "comment-filip": "The server.js location changed because we have now included client source files above .wasp/out/server/src.", "scripts": { - "bundle": "rollup --config --silent", + "bundle": "tsc --build && rollup --config --silent", "start": "node --enable-source-maps -r dotenv/config bundle/server.js", "bundle-and-start": "npm run bundle && npm run start", "watch": "nodemon --exec 'npm run bundle-and-start || exit 1'", diff --git a/waspc/data/Generator/templates/server/src/middleware/operations.ts b/waspc/data/Generator/templates/server/src/middleware/operations.ts index 44a8203368..7b042bab78 100644 --- a/waspc/data/Generator/templates/server/src/middleware/operations.ts +++ b/waspc/data/Generator/templates/server/src/middleware/operations.ts @@ -4,7 +4,9 @@ import { serialize as superjsonSerialize, } from 'superjson' import { handleRejection } from 'wasp/server/utils' +{=# isAuthEnabled =} import { makeAuthUserIfPossible } from 'wasp/auth/user' +{=/ isAuthEnabled =} export function createOperation (handlerFn) { return handleRejection(async (req, res) => { diff --git a/waspc/data/Generator/templates/server/src/webSocket/initialization.ts b/waspc/data/Generator/templates/server/src/webSocket/initialization.ts index 6489e8bafc..2a2f61955a 100644 --- a/waspc/data/Generator/templates/server/src/webSocket/initialization.ts +++ b/waspc/data/Generator/templates/server/src/webSocket/initialization.ts @@ -2,7 +2,6 @@ import http from 'http' import { Server, Socket } from 'socket.io' -import type { ServerType } from 'wasp/server/webSocket' import { config, prisma } from 'wasp/server' @@ -17,7 +16,7 @@ import { makeAuthUserIfPossible } from 'wasp/auth/user' export async function init(server: http.Server): Promise { // TODO: In the future, we can consider allowing a clustering option. // Ref: https://github.com/wasp-lang/wasp/issues/1228 - const io: ServerType = new Server(server, { + const io = new Server(server, { cors: { origin: config.frontendUrl, } 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 8153504a16..1a2381fbfb 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 @@ -228,7 +228,7 @@ "file", "../out/sdk/wasp/server/_types/serialization.ts" ], - "cfa5bcdd91e36fe35a91323bd3944a52873144101a5a03ae8a4f258cdd61ea03" + "a704021429b490f52edd4a2f150b4fed9a33f63d08d07b7f28e7b97a92cb4537" ], [ [ @@ -333,7 +333,7 @@ "file", "../out/sdk/wasp/server/utils.ts" ], - "688fdd57d6a9e9ead90141c6f0ebea9d39713d5bd7a630d43f2c2cb5a7984108" + "0b5999f8950b307896245f6a1aa6812fe100e889188a8b829b2824145b143d77" ], [ [ @@ -466,7 +466,7 @@ "file", "server/package.json" ], - "ae6d36c69a9a51addea31296c10660c039a47a0769848f8ea91db2c874480ebe" + "420c91443ea2bc0ac753c12699afbc3df72e3c8019b17eb8eb64c84998c6ae65" ], [ [ @@ -501,7 +501,7 @@ "file", "server/src/middleware/operations.ts" ], - "c165909021613cb6e389b324632f199d392b093d18109f05ab33b720c429c187" + "23efbb9c408f8c12bdb77359a48177430b7da636163562d0105560891ac225b9" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/env/schema.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/env/schema.d.ts index 033048b594..3f716d9baf 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/env/schema.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/env/schema.d.ts @@ -1,7 +1,7 @@ import * as z from 'zod'; -export declare const clientEnvSchema: z.ZodObject; -}>, "strip", z.ZodTypeAny, { +}, "strip", z.ZodTypeAny, { REACT_APP_API_URL: string; }, { REACT_APP_API_URL?: string | undefined; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.d.ts index 8338115ad9..3add2fee92 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/_types/serialization.d.ts @@ -6,11 +6,11 @@ export interface JSONObject { 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 { +export type SerializableJSONValue = symbol | Set | Map | undefined | bigint | Date | RegExp; +export type SuperJSONValue = JSONValue | SerializableJSONValue | SuperJSONArray | SuperJSONObject; +export interface SuperJSONArray extends Array { } -interface SuperJSONObject { +export interface SuperJSONObject { [key: string]: SuperJSONValue; } export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.d.ts index 972cf74d69..ae1520920b 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.d.ts @@ -7,7 +7,7 @@ type RequestWithExtraFields = Request & {}; * 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 handleRejection: (middleware: (req: Req, res: Res, next: NextFunction) => any) => (req: Req, res: Res, next: NextFunction) => Promise; export declare const sleep: (ms: number) => Promise; export declare function redirect(res: Response, redirectUri: string): Response>; export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.js.map index 9ca16bf322..8269017fad 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/utils.js.map @@ -1 +1 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../server/utils.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,UAIQ,EACR,EAAE,CACJ,KAAK,EAAE,GAA2B,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACvE,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,CAAA;IACb,CAAC;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;AAE5F,MAAM,UAAU,QAAQ,CAAC,GAAa,EAAE,WAAmB;IACzD,OAAO,GAAG;SACP,MAAM,CAAC,GAAG,CAAC;SACX,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC;SAClC,GAAG,EAAE,CAAC;AACX,CAAC"} \ No newline at end of file +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../server/utils.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,UAIQ,EACR,EAAE,CACJ,KAAK,EAAE,GAAQ,EAAE,GAAQ,EAAE,IAAkB,EAAE,EAAE;IAC/C,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,CAAA;IACb,CAAC;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;AAE5F,MAAM,UAAU,QAAQ,CAAC,GAAa,EAAE,WAAmB;IACzD,OAAO,GAAG;SACP,MAAM,CAAC,GAAG,CAAC;SACX,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC;SAClC,GAAG,EAAE,CAAC;AACX,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/_types/serialization.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/_types/serialization.ts index c8ff9c1ae3..8f9565dcd0 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/_types/serialization.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/_types/serialization.ts @@ -20,8 +20,8 @@ type PrimitiveJSONValue = string | number | boolean | undefined | null export interface JSONArray extends Array {} -type SerializableJSONValue = - | Symbol +export type SerializableJSONValue = + | symbol | Set | Map | undefined @@ -30,14 +30,14 @@ type SerializableJSONValue = | RegExp // Here's where we excluded `ClassInstance` (which was `any`) from the union. -type SuperJSONValue = +export type SuperJSONValue = | JSONValue | SerializableJSONValue | SuperJSONArray | SuperJSONObject -interface SuperJSONArray extends Array {} +export interface SuperJSONArray extends Array {} -interface SuperJSONObject { +export interface SuperJSONObject { [key: string]: SuperJSONValue } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/utils.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/utils.ts index 85ba9a4d8d..7141d7a98a 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/utils.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/utils.ts @@ -11,14 +11,14 @@ type RequestWithExtraFields = Request & { * if given middleware returns promise, reject of that promise will be correctly handled, * meaning that error will be forwarded to next(). */ -export const handleRejection = ( +export const handleRejection = ( middleware: ( - req: RequestWithExtraFields, - res: Response, + req: Req, + res: Res, next: NextFunction ) => any ) => -async (req: RequestWithExtraFields, res: Response, next: NextFunction) => { +async (req: Req, res: Res, next: NextFunction) => { try { await middleware(req, res, next) } catch (error) { 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 878864a41c..25269818dc 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 @@ -31,7 +31,7 @@ "prisma": {}, "private": true, "scripts": { - "bundle": "rollup --config --silent", + "bundle": "tsc --build && 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 bundle && node --enable-source-maps -r dotenv/config bundle/dbSeed.js", 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 3a830b72c1..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 @@ -3,7 +3,6 @@ import { serialize as superjsonSerialize, } from 'superjson' import { handleRejection } from 'wasp/server/utils' -import { makeAuthUserIfPossible } from 'wasp/auth/user' export function createOperation (handlerFn) { return handleRejection(async (req, res) => { diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts index 033048b594..3f716d9baf 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts @@ -1,7 +1,7 @@ import * as z from 'zod'; -export declare const clientEnvSchema: z.ZodObject; -}>, "strip", z.ZodTypeAny, { +}, "strip", z.ZodTypeAny, { REACT_APP_API_URL: string; }, { REACT_APP_API_URL?: string | undefined; 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 index 8338115ad9..3add2fee92 100644 --- 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 @@ -6,11 +6,11 @@ export interface JSONObject { 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 { +export type SerializableJSONValue = symbol | Set | Map | undefined | bigint | Date | RegExp; +export type SuperJSONValue = JSONValue | SerializableJSONValue | SuperJSONArray | SuperJSONObject; +export interface SuperJSONArray extends Array { } -interface SuperJSONObject { +export interface SuperJSONObject { [key: string]: SuperJSONValue; } export {}; 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 index 972cf74d69..ae1520920b 100644 --- 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 @@ -7,7 +7,7 @@ type RequestWithExtraFields = Request & {}; * 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 handleRejection: (middleware: (req: Req, res: Res, next: NextFunction) => any) => (req: Req, res: Res, next: NextFunction) => Promise; export declare const sleep: (ms: number) => Promise; export declare function redirect(res: Response, redirectUri: string): Response>; export {}; 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 index 9ca16bf322..8269017fad 100644 --- 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 @@ -1 +1 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../server/utils.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,UAIQ,EACR,EAAE,CACJ,KAAK,EAAE,GAA2B,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACvE,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,CAAA;IACb,CAAC;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;AAE5F,MAAM,UAAU,QAAQ,CAAC,GAAa,EAAE,WAAmB;IACzD,OAAO,GAAG;SACP,MAAM,CAAC,GAAG,CAAC;SACX,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC;SAClC,GAAG,EAAE,CAAC;AACX,CAAC"} \ No newline at end of file +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../server/utils.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,UAIQ,EACR,EAAE,CACJ,KAAK,EAAE,GAAQ,EAAE,GAAQ,EAAE,IAAkB,EAAE,EAAE;IAC/C,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,CAAA;IACb,CAAC;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;AAE5F,MAAM,UAAU,QAAQ,CAAC,GAAa,EAAE,WAAmB;IACzD,OAAO,GAAG;SACP,MAAM,CAAC,GAAG,CAAC;SACX,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC;SAClC,GAAG,EAAE,CAAC;AACX,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/_types/serialization.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/_types/serialization.ts index c8ff9c1ae3..8f9565dcd0 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/_types/serialization.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/_types/serialization.ts @@ -20,8 +20,8 @@ type PrimitiveJSONValue = string | number | boolean | undefined | null export interface JSONArray extends Array {} -type SerializableJSONValue = - | Symbol +export type SerializableJSONValue = + | symbol | Set | Map | undefined @@ -30,14 +30,14 @@ type SerializableJSONValue = | RegExp // Here's where we excluded `ClassInstance` (which was `any`) from the union. -type SuperJSONValue = +export type SuperJSONValue = | JSONValue | SerializableJSONValue | SuperJSONArray | SuperJSONObject -interface SuperJSONArray extends Array {} +export interface SuperJSONArray extends Array {} -interface SuperJSONObject { +export interface SuperJSONObject { [key: string]: SuperJSONValue } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/utils.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/utils.ts index 85ba9a4d8d..7141d7a98a 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/utils.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/utils.ts @@ -11,14 +11,14 @@ type RequestWithExtraFields = Request & { * if given middleware returns promise, reject of that promise will be correctly handled, * meaning that error will be forwarded to next(). */ -export const handleRejection = ( +export const handleRejection = ( middleware: ( - req: RequestWithExtraFields, - res: Response, + req: Req, + res: Res, next: NextFunction ) => any ) => -async (req: RequestWithExtraFields, res: Response, next: NextFunction) => { +async (req: Req, res: Res, next: NextFunction) => { try { await middleware(req, res, next) } catch (error) { 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 56028ffea0..79f4ff9c8a 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 @@ -228,7 +228,7 @@ "file", "../out/sdk/wasp/server/_types/serialization.ts" ], - "cfa5bcdd91e36fe35a91323bd3944a52873144101a5a03ae8a4f258cdd61ea03" + "a704021429b490f52edd4a2f150b4fed9a33f63d08d07b7f28e7b97a92cb4537" ], [ [ @@ -333,7 +333,7 @@ "file", "../out/sdk/wasp/server/utils.ts" ], - "688fdd57d6a9e9ead90141c6f0ebea9d39713d5bd7a630d43f2c2cb5a7984108" + "0b5999f8950b307896245f6a1aa6812fe100e889188a8b829b2824145b143d77" ], [ [ @@ -473,7 +473,7 @@ "file", "server/package.json" ], - "ae6d36c69a9a51addea31296c10660c039a47a0769848f8ea91db2c874480ebe" + "420c91443ea2bc0ac753c12699afbc3df72e3c8019b17eb8eb64c84998c6ae65" ], [ [ @@ -508,7 +508,7 @@ "file", "server/src/middleware/operations.ts" ], - "c165909021613cb6e389b324632f199d392b093d18109f05ab33b720c429c187" + "23efbb9c408f8c12bdb77359a48177430b7da636163562d0105560891ac225b9" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts index 033048b594..3f716d9baf 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts @@ -1,7 +1,7 @@ import * as z from 'zod'; -export declare const clientEnvSchema: z.ZodObject; -}>, "strip", z.ZodTypeAny, { +}, "strip", z.ZodTypeAny, { REACT_APP_API_URL: string; }, { REACT_APP_API_URL?: string | undefined; 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 index 8338115ad9..3add2fee92 100644 --- 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 @@ -6,11 +6,11 @@ export interface JSONObject { 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 { +export type SerializableJSONValue = symbol | Set | Map | undefined | bigint | Date | RegExp; +export type SuperJSONValue = JSONValue | SerializableJSONValue | SuperJSONArray | SuperJSONObject; +export interface SuperJSONArray extends Array { } -interface SuperJSONObject { +export interface SuperJSONObject { [key: string]: SuperJSONValue; } export {}; 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 index 972cf74d69..ae1520920b 100644 --- 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 @@ -7,7 +7,7 @@ type RequestWithExtraFields = Request & {}; * 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 handleRejection: (middleware: (req: Req, res: Res, next: NextFunction) => any) => (req: Req, res: Res, next: NextFunction) => Promise; export declare const sleep: (ms: number) => Promise; export declare function redirect(res: Response, redirectUri: string): Response>; export {}; 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 index 9ca16bf322..8269017fad 100644 --- 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 @@ -1 +1 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../server/utils.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,UAIQ,EACR,EAAE,CACJ,KAAK,EAAE,GAA2B,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACvE,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,CAAA;IACb,CAAC;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;AAE5F,MAAM,UAAU,QAAQ,CAAC,GAAa,EAAE,WAAmB;IACzD,OAAO,GAAG;SACP,MAAM,CAAC,GAAG,CAAC;SACX,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC;SAClC,GAAG,EAAE,CAAC;AACX,CAAC"} \ No newline at end of file +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../server/utils.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,UAIQ,EACR,EAAE,CACJ,KAAK,EAAE,GAAQ,EAAE,GAAQ,EAAE,IAAkB,EAAE,EAAE;IAC/C,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,CAAA;IACb,CAAC;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;AAE5F,MAAM,UAAU,QAAQ,CAAC,GAAa,EAAE,WAAmB;IACzD,OAAO,GAAG;SACP,MAAM,CAAC,GAAG,CAAC;SACX,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC;SAClC,GAAG,EAAE,CAAC;AACX,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/_types/serialization.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/_types/serialization.ts index c8ff9c1ae3..8f9565dcd0 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/_types/serialization.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/_types/serialization.ts @@ -20,8 +20,8 @@ type PrimitiveJSONValue = string | number | boolean | undefined | null export interface JSONArray extends Array {} -type SerializableJSONValue = - | Symbol +export type SerializableJSONValue = + | symbol | Set | Map | undefined @@ -30,14 +30,14 @@ type SerializableJSONValue = | RegExp // Here's where we excluded `ClassInstance` (which was `any`) from the union. -type SuperJSONValue = +export type SuperJSONValue = | JSONValue | SerializableJSONValue | SuperJSONArray | SuperJSONObject -interface SuperJSONArray extends Array {} +export interface SuperJSONArray extends Array {} -interface SuperJSONObject { +export interface SuperJSONObject { [key: string]: SuperJSONValue } diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/utils.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/utils.ts index 85ba9a4d8d..7141d7a98a 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/utils.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/utils.ts @@ -11,14 +11,14 @@ type RequestWithExtraFields = Request & { * if given middleware returns promise, reject of that promise will be correctly handled, * meaning that error will be forwarded to next(). */ -export const handleRejection = ( +export const handleRejection = ( middleware: ( - req: RequestWithExtraFields, - res: Response, + req: Req, + res: Res, next: NextFunction ) => any ) => -async (req: RequestWithExtraFields, res: Response, next: NextFunction) => { +async (req: Req, res: Res, next: NextFunction) => { try { await middleware(req, res, next) } catch (error) { 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 878864a41c..25269818dc 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 @@ -31,7 +31,7 @@ "prisma": {}, "private": true, "scripts": { - "bundle": "rollup --config --silent", + "bundle": "tsc --build && 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 bundle && node --enable-source-maps -r dotenv/config bundle/dbSeed.js", 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 3a830b72c1..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 @@ -3,7 +3,6 @@ import { serialize as superjsonSerialize, } from 'superjson' import { handleRejection } from 'wasp/server/utils' -import { makeAuthUserIfPossible } from 'wasp/auth/user' export function createOperation (handlerFn) { return handleRejection(async (req, res) => { 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 773531a5bc..6863366651 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 @@ -445,7 +445,7 @@ "file", "../out/sdk/wasp/server/_types/serialization.ts" ], - "cfa5bcdd91e36fe35a91323bd3944a52873144101a5a03ae8a4f258cdd61ea03" + "a704021429b490f52edd4a2f150b4fed9a33f63d08d07b7f28e7b97a92cb4537" ], [ [ @@ -494,7 +494,7 @@ "file", "../out/sdk/wasp/server/auth/oauth/provider.ts" ], - "f286a5c5f04b197bc5cf21711722b6265887dae1782a26e41124606616c27122" + "5b913ae922e7a2b409c06e84687786ade16694522b85b36a1ca11d365414f6bc" ], [ [ @@ -536,7 +536,7 @@ "file", "../out/sdk/wasp/server/crud/tasks.ts" ], - "d636a406237ecc06ac6d9225af503f11ee2617d556b662b4629c266f70c2c4d2" + "01b287e7ab116bb7d1f354a3b3201769c6c8e4f7bf7bb10b0e4daf13162b49e4" ], [ [ @@ -718,7 +718,7 @@ "file", "../out/sdk/wasp/server/utils.ts" ], - "d2e322edb5e1e8bd922b64adb0d6e4a9a3112413224b4da4b1fa7cc50cc3cebb" + "58788b34886c327e7c92504284f3bc39ccc096fb48cd6744836f7f6a40be8011" ], [ [ @@ -928,7 +928,7 @@ "file", "server/package.json" ], - "95d620f46b2d4e55da471e64552297c345572c8516299614534163ed273266e0" + "67601277da76302d467117afe39ab74d1f5797dcdde2a2e55ab8ea775d2d84be" ], [ [ 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 index 6ef5f6a14d..322b2fe418 100644 --- 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 @@ -2,7 +2,7 @@ import { GetQueryResolved, GetAllQueryResolved } from 'wasp/server/crud/tasks'; export declare const tasks: { get: { query: import("../operations/queries/core.js").QueryFor; - useQuery: (queryFnArgs?: import(".prisma/client").Prisma.TaskWhereUniqueInput | undefined, options?: any) => import("@tanstack/react-query").UseQueryResult<{ + useQuery: (queryFnArgs?: (import("../../server/_types/serialization.js").SuperJSONObject & import(".prisma/client").Prisma.TaskWhereUniqueInput) | undefined, options?: any) => import("@tanstack/react-query").UseQueryResult<{ id: number; description: string; isDone: boolean; @@ -17,14 +17,14 @@ export declare const tasks: { }[], Error>; }; create: { - action: (args: (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskUncheckedCreateInput) | (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskCreateInput)) => Promise<{ + action: (args: import("../../server/_types/serialization.js").SuperJSONObject & ((import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskUncheckedCreateInput) | (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskCreateInput))) => Promise<{ id: number; description: string; isDone: boolean; }>; useAction: (actionOptions?: { - optimisticUpdates: import("../operations/hooks.js").OptimisticUpdateDefinition<(import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskUncheckedCreateInput) | (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskCreateInput), any>[]; - } | undefined) => (args: (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskUncheckedCreateInput) | (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskCreateInput)) => Promise<{ + optimisticUpdates: import("../operations/hooks.js").OptimisticUpdateDefinition & import(".prisma/client").Prisma.TaskUncheckedCreateInput) | (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskCreateInput)), any>[]; + } | undefined) => (args: import("../../server/_types/serialization.js").SuperJSONObject & ((import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskUncheckedCreateInput) | (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskCreateInput))) => Promise<{ id: number; description: string; isDone: boolean; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts index 033048b594..3f716d9baf 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts @@ -1,7 +1,7 @@ import * as z from 'zod'; -export declare const clientEnvSchema: z.ZodObject; -}>, "strip", z.ZodTypeAny, { +}, "strip", z.ZodTypeAny, { REACT_APP_API_URL: string; }, { REACT_APP_API_URL?: string | undefined; 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 index 6e92049ea5..27f65c5038 100644 --- 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 @@ -13,5 +13,5 @@ declare const auth: (req: import("express").Request> & { user: import("../auth/user").AuthUserData | null; sessionId: string | null; -}, res: import("express").Response, next: import("express").NextFunction) => Promise; +}, res: import("express").Response>, next: import("express").NextFunction) => Promise; export default auth; 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 index 8338115ad9..3add2fee92 100644 --- 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 @@ -6,11 +6,11 @@ export interface JSONObject { 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 { +export type SerializableJSONValue = symbol | Set | Map | undefined | bigint | Date | RegExp; +export type SuperJSONValue = JSONValue | SerializableJSONValue | SuperJSONArray | SuperJSONObject; +export interface SuperJSONArray extends Array { } -interface SuperJSONObject { +export interface SuperJSONObject { [key: string]: SuperJSONValue; } export {}; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/provider.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/provider.d.ts index 8738b530a5..6f5aae05de 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/provider.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/provider.d.ts @@ -1,10 +1,10 @@ import { OAuth2Provider, OAuth2ProviderWithPKCE } from "arctic"; -export declare function defineProvider({ id, displayName, oAuthClient, }: { - id: string; +export declare function defineProvider({ id, displayName, oAuthClient, }: { + id: Id; displayName: string; oAuthClient: OAuthClient; }): { - id: string; + id: Id; displayName: string; oAuthClient: OAuthClient; }; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/provider.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/provider.js.map index cf0b0f6459..e3470a0031 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/provider.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/provider.js.map @@ -1 +1 @@ -{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../../server/auth/oauth/provider.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,cAAc,CAE5B,EACA,EAAE,EACF,WAAW,EACX,WAAW,GAKZ;IACC,OAAO;QACL,EAAE;QACF,WAAW;QACX,WAAW;KACZ,CAAC;AACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../../server/auth/oauth/provider.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,cAAc,CAG5B,EACA,EAAE,EACF,WAAW,EACX,WAAW,GAKZ;IACC,OAAO;QACL,EAAE;QACF,WAAW;QACX,WAAW;KACZ,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/auth/oauth/providers/google.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/providers/google.d.ts index bf13237ad7..b9e88bbdcd 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/providers/google.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/providers/google.d.ts @@ -1,6 +1,6 @@ import { Google } from 'arctic'; export declare const google: { - id: string; + id: "google"; displayName: string; oAuthClient: Google; }; 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 index e49498d1bf..a3df9d48f5 100644 --- 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 @@ -1,6 +1,6 @@ import type { AuthenticatedActionDefinition, AuthenticatedQueryDefinition, _Task } from "../_types"; import type { Prisma } from "@prisma/client"; -import type { Payload } from "../_types/serialization"; +import type { Payload, SuperJSONObject } from "../_types/serialization"; import type { Task } from "wasp/entities"; type _WaspEntityTagged = _Task; type _WaspEntity = Task; @@ -21,10 +21,10 @@ export declare namespace tasks { type GetAllInput = {}; type GetAllOutput = _WaspEntity[]; export type GetAllQueryResolved = tasks.GetAllQuery; -type GetInput = Prisma.TaskWhereUniqueInput; +type GetInput = SuperJSONObject & Prisma.TaskWhereUniqueInput; type GetOutput = _WaspEntity | null; export type GetQueryResolved = tasks.GetQuery; -type CreateInput = Prisma.XOR; +type CreateInput = SuperJSONObject & Prisma.XOR; 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/utils.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.d.ts index 59aa1413f5..be2e5e287b 100644 --- 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 @@ -11,7 +11,7 @@ type RequestWithExtraFields = Request & { * 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 handleRejection: (middleware: (req: Req, res: Res, next: NextFunction) => any) => (req: Req, res: Res, next: NextFunction) => Promise; export declare const sleep: (ms: number) => Promise; export declare function redirect(res: Response, redirectUri: string): Response>; export {}; 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 index 1b58c5ee90..44f0d819c7 100644 --- 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 @@ -1 +1 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../server/utils.ts"],"names":[],"mappings":"AASA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,UAIQ,EACR,EAAE,CACJ,KAAK,EAAE,GAA2B,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACvE,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,CAAA;IACb,CAAC;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;AAE5F,MAAM,UAAU,QAAQ,CAAC,GAAa,EAAE,WAAmB;IACzD,OAAO,GAAG;SACP,MAAM,CAAC,GAAG,CAAC;SACX,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC;SAClC,GAAG,EAAE,CAAC;AACX,CAAC"} \ No newline at end of file +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../server/utils.ts"],"names":[],"mappings":"AASA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,UAIQ,EACR,EAAE,CACJ,KAAK,EAAE,GAAQ,EAAE,GAAQ,EAAE,IAAkB,EAAE,EAAE;IAC/C,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,CAAA;IACb,CAAC;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;AAE5F,MAAM,UAAU,QAAQ,CAAC,GAAa,EAAE,WAAmB;IACzD,OAAO,GAAG;SACP,MAAM,CAAC,GAAG,CAAC;SACX,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC;SAClC,GAAG,EAAE,CAAC;AACX,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/_types/serialization.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/_types/serialization.ts index c8ff9c1ae3..8f9565dcd0 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/_types/serialization.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/_types/serialization.ts @@ -20,8 +20,8 @@ type PrimitiveJSONValue = string | number | boolean | undefined | null export interface JSONArray extends Array {} -type SerializableJSONValue = - | Symbol +export type SerializableJSONValue = + | symbol | Set | Map | undefined @@ -30,14 +30,14 @@ type SerializableJSONValue = | RegExp // Here's where we excluded `ClassInstance` (which was `any`) from the union. -type SuperJSONValue = +export type SuperJSONValue = | JSONValue | SerializableJSONValue | SuperJSONArray | SuperJSONObject -interface SuperJSONArray extends Array {} +export interface SuperJSONArray extends Array {} -interface SuperJSONObject { +export interface SuperJSONObject { [key: string]: SuperJSONValue } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/provider.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/provider.ts index c02e5adbee..3f2f81e905 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/provider.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/provider.ts @@ -1,13 +1,14 @@ import { OAuth2Provider, OAuth2ProviderWithPKCE } from "arctic"; export function defineProvider< - OAuthClient extends OAuth2Provider | OAuth2ProviderWithPKCE + OAuthClient extends OAuth2Provider | OAuth2ProviderWithPKCE, + const Id extends string >({ id, displayName, oAuthClient, }: { - id: string; + id: Id; displayName: string; oAuthClient: OAuthClient; }) { 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 index 9dc1e9cc48..169fdba6f7 100644 --- 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 @@ -4,7 +4,7 @@ import type { _Task, } from "../_types"; import type { Prisma } from "@prisma/client"; -import type { Payload } from "../_types/serialization"; +import type { Payload, SuperJSONObject } from "../_types/serialization"; import type { Task, } from "wasp/entities"; @@ -15,7 +15,7 @@ type _WaspEntity = Task /** * PUBLIC API */ -export namespace tasks { +export declare namespace tasks { export type GetAllQuery = AuthenticatedQueryDefinition<[_WaspEntityTagged], Input, Output> export type GetQuery = AuthenticatedQueryDefinition<[_WaspEntityTagged], Input, Output> @@ -27,7 +27,7 @@ export namespace tasks { /** * 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. */ @@ -35,11 +35,11 @@ type GetAllInput = {} type GetAllOutput = _WaspEntity[] export type GetAllQueryResolved = tasks.GetAllQuery -type GetInput = Prisma.TaskWhereUniqueInput +type GetInput = SuperJSONObject & Prisma.TaskWhereUniqueInput type GetOutput = _WaspEntity | null export type GetQueryResolved = tasks.GetQuery -type CreateInput = Prisma.XOR< +type CreateInput = SuperJSONObject & Prisma.XOR< Prisma.TaskCreateInput, Prisma.TaskUncheckedCreateInput > diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/utils.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/utils.ts index 153b591670..0863c05c47 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/utils.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/utils.ts @@ -14,14 +14,14 @@ type RequestWithExtraFields = Request & { * if given middleware returns promise, reject of that promise will be correctly handled, * meaning that error will be forwarded to next(). */ -export const handleRejection = ( +export const handleRejection = ( middleware: ( - req: RequestWithExtraFields, - res: Response, + req: Req, + res: Res, next: NextFunction ) => any ) => -async (req: RequestWithExtraFields, res: Response, next: NextFunction) => { +async (req: Req, res: Res, next: NextFunction) => { try { await middleware(req, res, next) } catch (error) { 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 a6070dbe9c..87fe4651f8 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 @@ -31,7 +31,7 @@ "prisma": {}, "private": true, "scripts": { - "bundle": "rollup --config --silent", + "bundle": "tsc --build && 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 bundle && node --enable-source-maps -r dotenv/config bundle/dbSeed.js", 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 a143cac9f3..94dc602978 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 @@ -228,7 +228,7 @@ "file", "../out/sdk/wasp/server/_types/serialization.ts" ], - "cfa5bcdd91e36fe35a91323bd3944a52873144101a5a03ae8a4f258cdd61ea03" + "a704021429b490f52edd4a2f150b4fed9a33f63d08d07b7f28e7b97a92cb4537" ], [ [ @@ -396,7 +396,7 @@ "file", "../out/sdk/wasp/server/utils.ts" ], - "688fdd57d6a9e9ead90141c6f0ebea9d39713d5bd7a630d43f2c2cb5a7984108" + "0b5999f8950b307896245f6a1aa6812fe100e889188a8b829b2824145b143d77" ], [ [ @@ -543,7 +543,7 @@ "file", "server/package.json" ], - "ae6d36c69a9a51addea31296c10660c039a47a0769848f8ea91db2c874480ebe" + "420c91443ea2bc0ac753c12699afbc3df72e3c8019b17eb8eb64c84998c6ae65" ], [ [ @@ -606,7 +606,7 @@ "file", "server/src/middleware/operations.ts" ], - "c165909021613cb6e389b324632f199d392b093d18109f05ab33b720c429c187" + "23efbb9c408f8c12bdb77359a48177430b7da636163562d0105560891ac225b9" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts index 033048b594..3f716d9baf 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts @@ -1,7 +1,7 @@ import * as z from 'zod'; -export declare const clientEnvSchema: z.ZodObject; -}>, "strip", z.ZodTypeAny, { +}, "strip", z.ZodTypeAny, { REACT_APP_API_URL: string; }, { REACT_APP_API_URL?: string | undefined; 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 index 8338115ad9..3add2fee92 100644 --- 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 @@ -6,11 +6,11 @@ export interface JSONObject { 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 { +export type SerializableJSONValue = symbol | Set | Map | undefined | bigint | Date | RegExp; +export type SuperJSONValue = JSONValue | SerializableJSONValue | SuperJSONArray | SuperJSONObject; +export interface SuperJSONArray extends Array { } -interface SuperJSONObject { +export interface SuperJSONObject { [key: string]: SuperJSONValue; } export {}; 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 index 972cf74d69..ae1520920b 100644 --- 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 @@ -7,7 +7,7 @@ type RequestWithExtraFields = Request & {}; * 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 handleRejection: (middleware: (req: Req, res: Res, next: NextFunction) => any) => (req: Req, res: Res, next: NextFunction) => Promise; export declare const sleep: (ms: number) => Promise; export declare function redirect(res: Response, redirectUri: string): Response>; export {}; 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 index 9ca16bf322..8269017fad 100644 --- 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 @@ -1 +1 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../server/utils.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,UAIQ,EACR,EAAE,CACJ,KAAK,EAAE,GAA2B,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACvE,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,CAAA;IACb,CAAC;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;AAE5F,MAAM,UAAU,QAAQ,CAAC,GAAa,EAAE,WAAmB;IACzD,OAAO,GAAG;SACP,MAAM,CAAC,GAAG,CAAC;SACX,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC;SAClC,GAAG,EAAE,CAAC;AACX,CAAC"} \ No newline at end of file +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../server/utils.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,UAIQ,EACR,EAAE,CACJ,KAAK,EAAE,GAAQ,EAAE,GAAQ,EAAE,IAAkB,EAAE,EAAE;IAC/C,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,CAAA;IACb,CAAC;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;AAE5F,MAAM,UAAU,QAAQ,CAAC,GAAa,EAAE,WAAmB;IACzD,OAAO,GAAG;SACP,MAAM,CAAC,GAAG,CAAC;SACX,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC;SAClC,GAAG,EAAE,CAAC;AACX,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/_types/serialization.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/_types/serialization.ts index c8ff9c1ae3..8f9565dcd0 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/_types/serialization.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/_types/serialization.ts @@ -20,8 +20,8 @@ type PrimitiveJSONValue = string | number | boolean | undefined | null export interface JSONArray extends Array {} -type SerializableJSONValue = - | Symbol +export type SerializableJSONValue = + | symbol | Set | Map | undefined @@ -30,14 +30,14 @@ type SerializableJSONValue = | RegExp // Here's where we excluded `ClassInstance` (which was `any`) from the union. -type SuperJSONValue = +export type SuperJSONValue = | JSONValue | SerializableJSONValue | SuperJSONArray | SuperJSONObject -interface SuperJSONArray extends Array {} +export interface SuperJSONArray extends Array {} -interface SuperJSONObject { +export interface SuperJSONObject { [key: string]: SuperJSONValue } diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/utils.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/utils.ts index 85ba9a4d8d..7141d7a98a 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/utils.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/utils.ts @@ -11,14 +11,14 @@ type RequestWithExtraFields = Request & { * if given middleware returns promise, reject of that promise will be correctly handled, * meaning that error will be forwarded to next(). */ -export const handleRejection = ( +export const handleRejection = ( middleware: ( - req: RequestWithExtraFields, - res: Response, + req: Req, + res: Res, next: NextFunction ) => any ) => -async (req: RequestWithExtraFields, res: Response, next: NextFunction) => { +async (req: Req, res: Res, next: NextFunction) => { try { await middleware(req, res, next) } catch (error) { 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 878864a41c..25269818dc 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 @@ -31,7 +31,7 @@ "prisma": {}, "private": true, "scripts": { - "bundle": "rollup --config --silent", + "bundle": "tsc --build && 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 bundle && node --enable-source-maps -r dotenv/config bundle/dbSeed.js", 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 3a830b72c1..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 @@ -3,7 +3,6 @@ import { serialize as superjsonSerialize, } from 'superjson' import { handleRejection } from 'wasp/server/utils' -import { makeAuthUserIfPossible } from 'wasp/auth/user' export function createOperation (handlerFn) { return handleRejection(async (req, res) => { 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 0d0e53ce8c..c789bb218f 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 @@ -228,7 +228,7 @@ "file", "../out/sdk/wasp/server/_types/serialization.ts" ], - "cfa5bcdd91e36fe35a91323bd3944a52873144101a5a03ae8a4f258cdd61ea03" + "a704021429b490f52edd4a2f150b4fed9a33f63d08d07b7f28e7b97a92cb4537" ], [ [ @@ -333,7 +333,7 @@ "file", "../out/sdk/wasp/server/utils.ts" ], - "688fdd57d6a9e9ead90141c6f0ebea9d39713d5bd7a630d43f2c2cb5a7984108" + "0b5999f8950b307896245f6a1aa6812fe100e889188a8b829b2824145b143d77" ], [ [ @@ -473,7 +473,7 @@ "file", "server/package.json" ], - "95d620f46b2d4e55da471e64552297c345572c8516299614534163ed273266e0" + "67601277da76302d467117afe39ab74d1f5797dcdde2a2e55ab8ea775d2d84be" ], [ [ @@ -508,7 +508,7 @@ "file", "server/src/middleware/operations.ts" ], - "c165909021613cb6e389b324632f199d392b093d18109f05ab33b720c429c187" + "23efbb9c408f8c12bdb77359a48177430b7da636163562d0105560891ac225b9" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts index 033048b594..3f716d9baf 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/env/schema.d.ts @@ -1,7 +1,7 @@ import * as z from 'zod'; -export declare const clientEnvSchema: z.ZodObject; -}>, "strip", z.ZodTypeAny, { +}, "strip", z.ZodTypeAny, { REACT_APP_API_URL: string; }, { REACT_APP_API_URL?: string | undefined; 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 index 8338115ad9..3add2fee92 100644 --- 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 @@ -6,11 +6,11 @@ export interface JSONObject { 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 { +export type SerializableJSONValue = symbol | Set | Map | undefined | bigint | Date | RegExp; +export type SuperJSONValue = JSONValue | SerializableJSONValue | SuperJSONArray | SuperJSONObject; +export interface SuperJSONArray extends Array { } -interface SuperJSONObject { +export interface SuperJSONObject { [key: string]: SuperJSONValue; } export {}; 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 index 972cf74d69..ae1520920b 100644 --- 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 @@ -7,7 +7,7 @@ type RequestWithExtraFields = Request & {}; * 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 handleRejection: (middleware: (req: Req, res: Res, next: NextFunction) => any) => (req: Req, res: Res, next: NextFunction) => Promise; export declare const sleep: (ms: number) => Promise; export declare function redirect(res: Response, redirectUri: string): Response>; export {}; 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 index 9ca16bf322..8269017fad 100644 --- 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 @@ -1 +1 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../server/utils.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,UAIQ,EACR,EAAE,CACJ,KAAK,EAAE,GAA2B,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACvE,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,CAAA;IACb,CAAC;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;AAE5F,MAAM,UAAU,QAAQ,CAAC,GAAa,EAAE,WAAmB;IACzD,OAAO,GAAG;SACP,MAAM,CAAC,GAAG,CAAC;SACX,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC;SAClC,GAAG,EAAE,CAAC;AACX,CAAC"} \ No newline at end of file +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../server/utils.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,UAIQ,EACR,EAAE,CACJ,KAAK,EAAE,GAAQ,EAAE,GAAQ,EAAE,IAAkB,EAAE,EAAE;IAC/C,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,CAAA;IACb,CAAC;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;AAE5F,MAAM,UAAU,QAAQ,CAAC,GAAa,EAAE,WAAmB;IACzD,OAAO,GAAG;SACP,MAAM,CAAC,GAAG,CAAC;SACX,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC;SAClC,GAAG,EAAE,CAAC;AACX,CAAC"} \ No newline at end of file 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 index c8ff9c1ae3..8f9565dcd0 100644 --- 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 @@ -20,8 +20,8 @@ type PrimitiveJSONValue = string | number | boolean | undefined | null export interface JSONArray extends Array {} -type SerializableJSONValue = - | Symbol +export type SerializableJSONValue = + | symbol | Set | Map | undefined @@ -30,14 +30,14 @@ type SerializableJSONValue = | RegExp // Here's where we excluded `ClassInstance` (which was `any`) from the union. -type SuperJSONValue = +export type SuperJSONValue = | JSONValue | SerializableJSONValue | SuperJSONArray | SuperJSONObject -interface SuperJSONArray extends Array {} +export interface SuperJSONArray extends Array {} -interface SuperJSONObject { +export interface SuperJSONObject { [key: string]: SuperJSONValue } 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 index 85ba9a4d8d..7141d7a98a 100644 --- 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 @@ -11,14 +11,14 @@ type RequestWithExtraFields = Request & { * if given middleware returns promise, reject of that promise will be correctly handled, * meaning that error will be forwarded to next(). */ -export const handleRejection = ( +export const handleRejection = ( middleware: ( - req: RequestWithExtraFields, - res: Response, + req: Req, + res: Res, next: NextFunction ) => any ) => -async (req: RequestWithExtraFields, res: Response, next: NextFunction) => { +async (req: Req, res: Res, next: NextFunction) => { try { await middleware(req, res, next) } catch (error) { 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 a6070dbe9c..87fe4651f8 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 @@ -31,7 +31,7 @@ "prisma": {}, "private": true, "scripts": { - "bundle": "rollup --config --silent", + "bundle": "tsc --build && 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 bundle && node --enable-source-maps -r dotenv/config bundle/dbSeed.js", 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 3a830b72c1..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 @@ -3,7 +3,6 @@ import { serialize as superjsonSerialize, } from 'superjson' import { handleRejection } from 'wasp/server/utils' -import { makeAuthUserIfPossible } from 'wasp/auth/user' export function createOperation (handlerFn) { return handleRejection(async (req, res) => { diff --git a/waspc/examples/todo-typescript/package-lock.json b/waspc/examples/todo-typescript/package-lock.json index 3ab5586350..738dd9feef 100644 --- a/waspc/examples/todo-typescript/package-lock.json +++ b/waspc/examples/todo-typescript/package-lock.json @@ -56,7 +56,8 @@ "zod": "^3.23.8" }, "devDependencies": { - "@tsconfig/node18": "latest", + "@tsconfig/node20": "latest", + "@types/express": "^4.17.13", "@types/express-serve-static-core": "^4.17.13" } }, @@ -2032,11 +2033,12 @@ "node": ">= 10" } }, - "node_modules/@tsconfig/node18": { - "version": "18.2.4", - "resolved": "https://registry.npmjs.org/@tsconfig/node18/-/node18-18.2.4.tgz", - "integrity": "sha512-5xxU8vVs9/FNcvm3gE07fPbn9tl6tqGGWA9tSlwsUEkBxtRnTsNmwrV8gasZ9F/EobaSv9+nu8AxUKccw77JpQ==", - "dev": true + "node_modules/@tsconfig/node20": { + "version": "20.1.5", + "resolved": "https://registry.npmjs.org/@tsconfig/node20/-/node20-20.1.5.tgz", + "integrity": "sha512-Vm8e3WxDTqMGPU4GATF9keQAIy1Drd7bPwlgzKJnZtoOsTm1tduUTbDjg0W5qERvGuxPI2h9RbMufH0YdfBylA==", + "dev": true, + "license": "MIT" }, "node_modules/@tybys/wasm-util": { "version": "0.8.1", diff --git a/waspc/examples/todoApp/README.md b/waspc/examples/todoApp/README.md index 8896b3cb34..680d3fef30 100644 --- a/waspc/examples/todoApp/README.md +++ b/waspc/examples/todoApp/README.md @@ -55,7 +55,7 @@ NOTE: Normally wasp apps open automatically in browser, to help new users find t ### Compiling and building -Run `./ensure_app_compiles_and_builds.sh` to verify the app correctly compiles (TS) and builds (both client and server). +From the parent `waspc` folder, run `./tools/ensure_app_compiles_and_builds.sh examples/todoApp` to verify the app correctly compiles (TS) and builds (both client and server). This is also run in CI. diff --git a/waspc/examples/todoApp/package-lock.json b/waspc/examples/todoApp/package-lock.json index cf2b0a136e..fa7d8f7e7d 100644 --- a/waspc/examples/todoApp/package-lock.json +++ b/waspc/examples/todoApp/package-lock.json @@ -47,6 +47,7 @@ "lucia": "^3.0.1", "mitt": "3.0.0", "msw": "^1.1.0", + "nodemailer": "^6.9.1", "oslo": "^1.1.2", "pg-boss": "^8.4.2", "postcss": "^8.4.21", diff --git a/waspc/examples/todoApp/ensure_app_compiles_and_builds.sh b/waspc/tools/ensure_app_compiles_and_builds.sh similarity index 73% rename from waspc/examples/todoApp/ensure_app_compiles_and_builds.sh rename to waspc/tools/ensure_app_compiles_and_builds.sh index aa7f064f9b..eb4c20f563 100755 --- a/waspc/examples/todoApp/ensure_app_compiles_and_builds.sh +++ b/waspc/tools/ensure_app_compiles_and_builds.sh @@ -5,7 +5,7 @@ # make sure we don't accidentally add anything that causes `tsc` to error out. # Gets the directory of where this script lives. -dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +dir="$1" echo "Running ensure_app_compiles_and_builds.sh from $dir" cd "$dir" @@ -14,13 +14,16 @@ cd "$dir" cabal run wasp-cli build echo "Ensure the user's code has no TypeScript errors (shown in the IDE)." -npx tsc --noEmit --skipLibCheck +npx tsc --noEmit --skipLibCheck --project . # Make sure they build. echo "Ensure client builds" cd .wasp/build/web-app npm run build +npx tsc --noEmit --skipLibCheck --project ./tsconfig.vite.json +npx tsc --noEmit --skipLibCheck --project ./tsconfig.app.json echo "Ensure server bundles" cd ../server npm run bundle +npx tsc --noEmit --skipLibCheck --project ./tsconfig.json