diff --git a/waspc/data/Generator/templates/react-app/src/auth/email/actions/login.ts b/waspc/data/Generator/templates/react-app/src/auth/email/actions/login.ts index 121a65a1e..c287486ef 100644 --- a/waspc/data/Generator/templates/react-app/src/auth/email/actions/login.ts +++ b/waspc/data/Generator/templates/react-app/src/auth/email/actions/login.ts @@ -6,7 +6,7 @@ export async function login(data: { email: string; password: string }): Promise< try { const response = await api.post('{= loginPath =}', data); await initSession(response.data.token); - } catch (e: unknown) { + } catch (e) { handleApiError(e); } } diff --git a/waspc/data/Generator/templates/react-app/src/auth/email/actions/passwordReset.ts b/waspc/data/Generator/templates/react-app/src/auth/email/actions/passwordReset.ts index 68e6fa814..b37cb2761 100644 --- a/waspc/data/Generator/templates/react-app/src/auth/email/actions/passwordReset.ts +++ b/waspc/data/Generator/templates/react-app/src/auth/email/actions/passwordReset.ts @@ -5,7 +5,7 @@ export async function requestPasswordReset(data: { email: string; }): Promise<{ try { const response = await api.post('{= requestPasswordResetPath =}', data); return response.data; - } catch (e: unknown) { + } catch (e) { handleApiError(e); } } @@ -14,7 +14,7 @@ export async function resetPassword(data: { token: string; password: string; }): try { const response = await api.post('{= resetPasswordPath =}', data); return response.data; - } catch (e: unknown) { + } catch (e) { handleApiError(e); } } diff --git a/waspc/data/Generator/templates/react-app/src/auth/email/actions/signup.ts b/waspc/data/Generator/templates/react-app/src/auth/email/actions/signup.ts index 3095b4317..ad2a37eb8 100644 --- a/waspc/data/Generator/templates/react-app/src/auth/email/actions/signup.ts +++ b/waspc/data/Generator/templates/react-app/src/auth/email/actions/signup.ts @@ -5,7 +5,7 @@ export async function signup(data: { email: string; password: string }): Promise try { const response = await api.post('{= signupPath =}', data); return response.data; - } catch (e: unknown) { + } catch (e) { handleApiError(e); } } diff --git a/waspc/data/Generator/templates/react-app/src/auth/email/actions/verifyEmail.ts b/waspc/data/Generator/templates/react-app/src/auth/email/actions/verifyEmail.ts index cfeb90edd..4c2cfff58 100644 --- a/waspc/data/Generator/templates/react-app/src/auth/email/actions/verifyEmail.ts +++ b/waspc/data/Generator/templates/react-app/src/auth/email/actions/verifyEmail.ts @@ -1,11 +1,13 @@ {{={= =}=}} -import api, { handleApiError } from '../../../api'; +import api, { handleApiError } from '../../../api' -export async function verifyEmail(data: { token: string; }): Promise<{ success: boolean; reason?: string; }> { - try { - const response = await api.post('{= verifyEmailPath =}', data); - return response.data; - } catch (e: unknown) { - handleApiError(e); - } +export async function verifyEmail(data: { + token: string +}): Promise<{ success: boolean; reason?: string }> { + try { + const response = await api.post('{= verifyEmailPath =}', data) + return response.data + } catch (e) { + handleApiError(e) + } } diff --git a/waspc/data/Generator/templates/react-app/src/auth/forms/Auth.tsx b/waspc/data/Generator/templates/react-app/src/auth/forms/Auth.tsx index b048e2278..afe6479e7 100644 --- a/waspc/data/Generator/templates/react-app/src/auth/forms/Auth.tsx +++ b/waspc/data/Generator/templates/react-app/src/auth/forms/Auth.tsx @@ -265,7 +265,7 @@ function Auth ({ state, appearance, logo, socialLayout = 'horizontal' }: { // TODO(matija): this is called on every render, is it a problem? // If we do it in useEffect(), then there is a glitch between the default color and the // user provided one. - const customTheme = createTheme(appearance) + const customTheme = createTheme(appearance ?? {}) const cta = isLogin ? 'Log in' : 'Sign up' const titles: Record = { @@ -497,7 +497,7 @@ const VerifyEmailForm = ({ isLoading, setIsLoading, setErrorMessage, setSuccessM const location = useLocation() const token = new URLSearchParams(location.search).get('token') - const submitForm = useCallback(async () => { + async function submitForm() { if (!token) { setErrorMessage('The token is missing from the URL. Please check the link you received in your email.') return @@ -513,7 +513,7 @@ const VerifyEmailForm = ({ isLoading, setIsLoading, setErrorMessage, setSuccessM } finally { setIsLoading(false) } - }) + } useEffect(() => { submitForm() diff --git a/waspc/data/Generator/templates/react-app/tsconfig.json b/waspc/data/Generator/templates/react-app/tsconfig.json index fdeb6c94b..c5012408c 100644 --- a/waspc/data/Generator/templates/react-app/tsconfig.json +++ b/waspc/data/Generator/templates/react-app/tsconfig.json @@ -2,6 +2,7 @@ "extends": "@tsconfig/vite-react/tsconfig.json", "compilerOptions": { // Temporary loosen the type checking until we can address all the errors. + "jsx": "preserve", "allowJs": true, "strict": false }, diff --git a/waspc/data/Generator/templates/server/src/types/index.ts b/waspc/data/Generator/templates/server/src/types/index.ts index 6ce951f7b..cc80863c6 100644 --- a/waspc/data/Generator/templates/server/src/types/index.ts +++ b/waspc/data/Generator/templates/server/src/types/index.ts @@ -1,6 +1,6 @@ {{={= =}=}} -import { Application } from 'express' +import { type Application } from 'express' import { Server } from 'http' export type ServerSetupFn = (context: ServerSetupFnContext) => Promise @@ -10,13 +10,13 @@ export type ServerSetupFnContext = { server: Server, } -export { Application } from 'express' +export type { Application } from 'express' export { Server } from 'http' {=# isExternalAuthEnabled =} -export { GetUserFieldsFn } from '../auth/providers/oauth/types'; +export type { GetUserFieldsFn } from '../auth/providers/oauth/types'; {=/ isExternalAuthEnabled =} {=# isEmailAuthEnabled =} -export { GetVerificationEmailContentFn, GetPasswordResetEmailContentFn } from '../auth/providers/email/types'; +export type { GetVerificationEmailContentFn, GetPasswordResetEmailContentFn } from '../auth/providers/email/types'; {=/ isEmailAuthEnabled =} 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 8e218ffca..736661150 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 @@ -214,7 +214,7 @@ "file", "server/src/types/index.ts" ], - "82570549b7c746ecc2f95f7497750a506dd297c131c41bd05547de8c844adeda" + "1fd50e251e340a5bc8c51369766e8c889cf892cdbe6593b4d58a6ee585b6d2cc" ], [ [ @@ -529,7 +529,7 @@ "file", "web-app/tsconfig.json" ], - "27e39dd3e6155ffccdb1d9cb0cba8db7d9e06e10958bee900340a2d9f17400c8" + "887c55937264ea8b2c538340962c3011091cf3eb6b9d39523acbe8ebcdd35474" ], [ [ 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/build/server/src/types/index.ts index c601eef36..bef664aac 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/build/server/src/types/index.ts @@ -1,5 +1,5 @@ -import { Application } from 'express' +import { type Application } from 'express' import { Server } from 'http' export type ServerSetupFn = (context: ServerSetupFnContext) => Promise @@ -9,7 +9,7 @@ export type ServerSetupFnContext = { server: Server, } -export { Application } from 'express' +export type { Application } from 'express' export { Server } from 'http' 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 fdeb6c94b..c5012408c 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 @@ -2,6 +2,7 @@ "extends": "@tsconfig/vite-react/tsconfig.json", "compilerOptions": { // Temporary loosen the type checking until we can address all the errors. + "jsx": "preserve", "allowJs": true, "strict": false }, 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 572451a43..25fc0a55e 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 @@ -221,7 +221,7 @@ "file", "server/src/types/index.ts" ], - "82570549b7c746ecc2f95f7497750a506dd297c131c41bd05547de8c844adeda" + "1fd50e251e340a5bc8c51369766e8c889cf892cdbe6593b4d58a6ee585b6d2cc" ], [ [ @@ -543,7 +543,7 @@ "file", "web-app/tsconfig.json" ], - "27e39dd3e6155ffccdb1d9cb0cba8db7d9e06e10958bee900340a2d9f17400c8" + "887c55937264ea8b2c538340962c3011091cf3eb6b9d39523acbe8ebcdd35474" ], [ [ 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/server/src/types/index.ts index c601eef36..bef664aac 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/server/src/types/index.ts @@ -1,5 +1,5 @@ -import { Application } from 'express' +import { type Application } from 'express' import { Server } from 'http' export type ServerSetupFn = (context: ServerSetupFnContext) => Promise @@ -9,7 +9,7 @@ export type ServerSetupFnContext = { server: Server, } -export { Application } from 'express' +export type { Application } from 'express' export { Server } from 'http' 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 fdeb6c94b..c5012408c 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 @@ -2,6 +2,7 @@ "extends": "@tsconfig/vite-react/tsconfig.json", "compilerOptions": { // Temporary loosen the type checking until we can address all the errors. + "jsx": "preserve", "allowJs": true, "strict": false }, 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 cb753d244..11896b814 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", "server/src/types/index.ts" ], - "6b9dcc39aee89af771c01c9daf84aa769968081dd9b1b22a96e98f09366b06a8" + "04e01e653bd889436903843cf1dae0a6ba0ecbc1c369beef0e90fae4d0c21127" ], [ [ @@ -592,7 +592,7 @@ "file", "web-app/src/auth/forms/Auth.tsx" ], - "f62b429c2a3749e8147198184d4612de7d1a82d1370696487b1aa65eb2e4b5b9" + "6e74c3affea9fdc6c71d94fa2875298b4e5bdcf71b89b63320d0a52d81c18652" ], [ [ @@ -907,7 +907,7 @@ "file", "web-app/tsconfig.json" ], - "27e39dd3e6155ffccdb1d9cb0cba8db7d9e06e10958bee900340a2d9f17400c8" + "887c55937264ea8b2c538340962c3011091cf3eb6b9d39523acbe8ebcdd35474" ], [ [ 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/server/src/types/index.ts index ecf8bc0e3..6ac9afb13 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/server/src/types/index.ts @@ -1,5 +1,5 @@ -import { Application } from 'express' +import { type Application } from 'express' import { Server } from 'http' export type ServerSetupFn = (context: ServerSetupFnContext) => Promise @@ -9,8 +9,8 @@ export type ServerSetupFnContext = { server: Server, } -export { Application } from 'express' +export type { Application } from 'express' export { Server } from 'http' -export { GetUserFieldsFn } from '../auth/providers/oauth/types'; +export type { GetUserFieldsFn } from '../auth/providers/oauth/types'; 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/web-app/src/auth/forms/Auth.tsx index 555005515..837da3b8a 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/web-app/src/auth/forms/Auth.tsx @@ -205,7 +205,7 @@ function Auth ({ state, appearance, logo, socialLayout = 'horizontal' }: { // TODO(matija): this is called on every render, is it a problem? // If we do it in useEffect(), then there is a glitch between the default color and the // user provided one. - const customTheme = createTheme(appearance) + const customTheme = createTheme(appearance ?? {}) const cta = isLogin ? 'Log in' : 'Sign up' const titles: Record = { 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 fdeb6c94b..c5012408c 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 @@ -2,6 +2,7 @@ "extends": "@tsconfig/vite-react/tsconfig.json", "compilerOptions": { // Temporary loosen the type checking until we can address all the errors. + "jsx": "preserve", "allowJs": true, "strict": false }, 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 c09367ae4..9caf037e6 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 @@ -235,7 +235,7 @@ "file", "server/src/types/index.ts" ], - "82570549b7c746ecc2f95f7497750a506dd297c131c41bd05547de8c844adeda" + "1fd50e251e340a5bc8c51369766e8c889cf892cdbe6593b4d58a6ee585b6d2cc" ], [ [ @@ -557,7 +557,7 @@ "file", "web-app/tsconfig.json" ], - "27e39dd3e6155ffccdb1d9cb0cba8db7d9e06e10958bee900340a2d9f17400c8" + "887c55937264ea8b2c538340962c3011091cf3eb6b9d39523acbe8ebcdd35474" ], [ [ 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/server/src/types/index.ts index c601eef36..bef664aac 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/server/src/types/index.ts @@ -1,5 +1,5 @@ -import { Application } from 'express' +import { type Application } from 'express' import { Server } from 'http' export type ServerSetupFn = (context: ServerSetupFnContext) => Promise @@ -9,7 +9,7 @@ export type ServerSetupFnContext = { server: Server, } -export { Application } from 'express' +export type { Application } from 'express' export { Server } from 'http' 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 fdeb6c94b..c5012408c 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 @@ -2,6 +2,7 @@ "extends": "@tsconfig/vite-react/tsconfig.json", "compilerOptions": { // Temporary loosen the type checking until we can address all the errors. + "jsx": "preserve", "allowJs": true, "strict": false }, 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 6e9e37b54..b910764f7 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 @@ -221,7 +221,7 @@ "file", "server/src/types/index.ts" ], - "82570549b7c746ecc2f95f7497750a506dd297c131c41bd05547de8c844adeda" + "1fd50e251e340a5bc8c51369766e8c889cf892cdbe6593b4d58a6ee585b6d2cc" ], [ [ @@ -543,7 +543,7 @@ "file", "web-app/tsconfig.json" ], - "27e39dd3e6155ffccdb1d9cb0cba8db7d9e06e10958bee900340a2d9f17400c8" + "887c55937264ea8b2c538340962c3011091cf3eb6b9d39523acbe8ebcdd35474" ], [ [ 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 index c601eef36..bef664aac 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/server/src/types/index.ts @@ -1,5 +1,5 @@ -import { Application } from 'express' +import { type Application } from 'express' import { Server } from 'http' export type ServerSetupFn = (context: ServerSetupFnContext) => Promise @@ -9,7 +9,7 @@ export type ServerSetupFnContext = { server: Server, } -export { Application } from 'express' +export type { Application } from 'express' export { Server } from 'http' 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 fdeb6c94b..c5012408c 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 @@ -2,6 +2,7 @@ "extends": "@tsconfig/vite-react/tsconfig.json", "compilerOptions": { // Temporary loosen the type checking until we can address all the errors. + "jsx": "preserve", "allowJs": true, "strict": false },