diff --git a/waspc/data/Generator/templates/Dockerfile b/waspc/data/Generator/templates/Dockerfile index f0713ce6db..f4e271e055 100644 --- a/waspc/data/Generator/templates/Dockerfile +++ b/waspc/data/Generator/templates/Dockerfile @@ -55,15 +55,15 @@ WORKDIR /app # Copying the top level 'node_modules' because it contains the Prisma packages # necessary for migrating the database. COPY --from=server-builder /app/node_modules ./node_modules -# Copying the SDK because 'validate-env.mjs' executes independent of the bundle +# Copying the SDK because the server bundle doesn't bundle the SDK # and references the 'wasp' package. COPY --from=server-builder /app/.wasp/out/sdk .wasp/out/sdk -# Copying 'server/node_modules' because 'validate-env.mjs' executes independent -# of the bundle and references the dotenv package. +# Copying 'server/node_modules' because we require dotenv package to +# load environment variables +# TODO: replace dotenv with native Node.js environment variable loading COPY --from=server-builder /app/.wasp/build/server/node_modules .wasp/build/server/node_modules COPY --from=server-builder /app/.wasp/build/server/bundle .wasp/build/server/bundle COPY --from=server-builder /app/.wasp/build/server/package*.json .wasp/build/server/ -COPY --from=server-builder /app/.wasp/build/server/scripts .wasp/build/server/scripts COPY db/ .wasp/build/db/ EXPOSE ${PORT} WORKDIR /app/.wasp/build/server diff --git a/waspc/data/Generator/templates/react-app/prettier.config.js b/waspc/data/Generator/templates/prettier.config.js similarity index 100% rename from waspc/data/Generator/templates/react-app/prettier.config.js rename to waspc/data/Generator/templates/prettier.config.js diff --git a/waspc/data/Generator/templates/react-app/package.json b/waspc/data/Generator/templates/react-app/package.json index c27f6b4e5a..9d87242f08 100644 --- a/waspc/data/Generator/templates/react-app/package.json +++ b/waspc/data/Generator/templates/react-app/package.json @@ -7,9 +7,8 @@ {=& depsChunk =}, {=& devDepsChunk =}, "scripts": { - "start": "npm run validate-env && vite", - "build": "npm run validate-env && tsc && vite build", - "validate-env": "node -r dotenv/config ./scripts/validate-env.mjs" + "start": "vite", + "build": "tsc && vite build" }, "engineStrict": true, "engines": { diff --git a/waspc/data/Generator/templates/react-app/scripts/validate-env.mjs b/waspc/data/Generator/templates/react-app/scripts/validate-env.mjs deleted file mode 100644 index 18ee507c9e..0000000000 --- a/waspc/data/Generator/templates/react-app/scripts/validate-env.mjs +++ /dev/null @@ -1,4 +0,0 @@ -import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; - -console.info("🔍 Validating environment variables..."); -throwIfNotValidAbsoluteURL(process.env.REACT_APP_API_URL, 'Environemnt variable REACT_APP_API_URL'); diff --git a/waspc/data/Generator/templates/react-app/src/components/DefaultRootErrorBoundary.tsx b/waspc/data/Generator/templates/react-app/src/components/DefaultRootErrorBoundary.tsx index 7af24e15d6..1e931935e6 100644 --- a/waspc/data/Generator/templates/react-app/src/components/DefaultRootErrorBoundary.tsx +++ b/waspc/data/Generator/templates/react-app/src/components/DefaultRootErrorBoundary.tsx @@ -7,7 +7,10 @@ export function DefaultRootErrorBoundary() { console.error(error) return ( -
There was an error rendering this page. Check the browser console for more information.
+
+ There was an error rendering this page. Check the browser console for + more information. +
) } diff --git a/waspc/data/Generator/templates/sdk/wasp/client/config.ts b/waspc/data/Generator/templates/sdk/wasp/client/config.ts index 39b620af01..fff77cb01c 100644 --- a/waspc/data/Generator/templates/sdk/wasp/client/config.ts +++ b/waspc/data/Generator/templates/sdk/wasp/client/config.ts @@ -1,7 +1,7 @@ -{{={= =}=}} import { stripTrailingSlash } from '../universal/url.js' +import { env } from './env.js' -const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || '{= defaultServerUrl =}'; +const apiUrl = stripTrailingSlash(env.REACT_APP_API_URL) // PUBLIC API export type ClientConfig = { diff --git a/waspc/data/Generator/templates/sdk/wasp/client/env.ts b/waspc/data/Generator/templates/sdk/wasp/client/env.ts new file mode 100644 index 0000000000..8921eb5ccb --- /dev/null +++ b/waspc/data/Generator/templates/sdk/wasp/client/env.ts @@ -0,0 +1,25 @@ +{{={= =}=}} +import * as z from 'zod' + +import { ensureEnvSchema } from '../env/validation.js' + +{=# envValidationSchema.isDefined =} +{=& envValidationSchema.importStatement =} +const userClientEnvSchema = {= envValidationSchema.importIdentifier =} +{=/ envValidationSchema.isDefined =} +{=^ envValidationSchema.isDefined =} +const userClientEnvSchema = z.object({}) +{=/ envValidationSchema.isDefined =} + +const waspClientEnvSchema = z.object({ + REACT_APP_API_URL: z + .string({ + required_error: 'REACT_APP_API_URL is required', + }) + .default('{= defaultServerUrl =}') +}) + +const clientEnvSchema = userClientEnvSchema.merge(waspClientEnvSchema) + +// PUBLIC API +export const env = ensureEnvSchema(import.meta.env, clientEnvSchema) diff --git a/waspc/data/Generator/templates/sdk/wasp/client/index.ts b/waspc/data/Generator/templates/sdk/wasp/client/index.ts index cfce564c4d..859f8656b6 100644 --- a/waspc/data/Generator/templates/sdk/wasp/client/index.ts +++ b/waspc/data/Generator/templates/sdk/wasp/client/index.ts @@ -11,4 +11,7 @@ export enum HttpMethod { export type Route = { method: HttpMethod; path: string } // PUBLIC API -export { config, ClientConfig } from './config' +export { config, ClientConfig } from './config.js' + +// PUBLIC API +export { env } from './env.js' diff --git a/waspc/data/Generator/templates/sdk/wasp/env/index.ts b/waspc/data/Generator/templates/sdk/wasp/env/index.ts new file mode 100644 index 0000000000..4c783125c1 --- /dev/null +++ b/waspc/data/Generator/templates/sdk/wasp/env/index.ts @@ -0,0 +1,11 @@ +import * as z from 'zod' + +// PUBLIC API +export function defineEnvValidationSchema>( + schema: Schema, +): Schema { + return schema +} + +// PRIVATE API (SDK, Vite config) +export { ensureEnvSchema } from './validation.js' diff --git a/waspc/data/Generator/templates/sdk/wasp/env/validation.ts b/waspc/data/Generator/templates/sdk/wasp/env/validation.ts new file mode 100644 index 0000000000..a5bc334754 --- /dev/null +++ b/waspc/data/Generator/templates/sdk/wasp/env/validation.ts @@ -0,0 +1,25 @@ +import * as z from 'zod' + +const redColor = '\x1b[31m' + +export function ensureEnvSchema( + data: unknown, + schema: Schema +): z.infer { + try { + return schema.parse(data) + } catch (e) { + if (e instanceof z.ZodError) { + const errorOutput = ['', '══ Env vars validation failed ══', ''] + for (const error of e.errors) { + errorOutput.push(` - ${error.message}`) + } + errorOutput.push('') + errorOutput.push('════════════════════════════════') + console.error(redColor, errorOutput.join('\n')) + throw new Error('Error parsing environment variables') + } else { + throw e + } + } +} diff --git a/waspc/data/Generator/templates/sdk/wasp/package.json b/waspc/data/Generator/templates/sdk/wasp/package.json index 5995a7e777..440c10e913 100644 --- a/waspc/data/Generator/templates/sdk/wasp/package.json +++ b/waspc/data/Generator/templates/sdk/wasp/package.json @@ -109,6 +109,7 @@ "./client/test": "./dist/client/test/index.js", "./client": "./dist/client/index.js", "./dev": "./dist/dev/index.js", + "./env": "./dist/env/index.js", {=! todo(filip): Fixes below are for type errors in 0.13.1, remove ASAP =} {=! Used by our code (SDK for full-stack type safety), uncodumented (but accessible) for users. =} diff --git a/waspc/data/Generator/templates/sdk/wasp/server/HttpError.ts b/waspc/data/Generator/templates/sdk/wasp/server/HttpError.ts index d05a2c841b..bce964712d 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/HttpError.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/HttpError.ts @@ -2,7 +2,12 @@ export class HttpError extends Error { public statusCode: number public data: unknown - constructor (statusCode: number, message?: string, data?: Record, options?: ErrorOptions) { + constructor( + statusCode: number, + message?: string, + data?: Record, + options?: ErrorOptions + ) { super(message, options) if (Error.captureStackTrace) { @@ -11,7 +16,9 @@ export class HttpError extends Error { this.name = this.constructor.name - if (!(Number.isInteger(statusCode) && statusCode >= 400 && statusCode < 600)) { + if ( + !(Number.isInteger(statusCode) && statusCode >= 400 && statusCode < 600) + ) { throw new Error('statusCode has to be integer in range [400, 600).') } this.statusCode = statusCode diff --git a/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/env.ts b/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/env.ts deleted file mode 100644 index ada2452b8e..0000000000 --- a/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/env.ts +++ /dev/null @@ -1,15 +0,0 @@ -// PRIVATE API (SDK) -export function ensureEnvVarsForProvider( - envVarNames: EnvVarName[], - providerName: string, -): Record { - const result: Record = {}; - for (const envVarName of envVarNames) { - const value = process.env[envVarName]; - if (!value) { - throw new Error(`${envVarName} env variable is required when using the ${providerName} auth provider.`); - } - result[envVarName] = value; - } - return result as Record; -} 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 c2aee70897..c02e5adbee 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,23 +1,19 @@ import { OAuth2Provider, OAuth2ProviderWithPKCE } from "arctic"; export function defineProvider< - OAuthClient extends OAuth2Provider | OAuth2ProviderWithPKCE, - Env extends Record + OAuthClient extends OAuth2Provider | OAuth2ProviderWithPKCE >({ id, displayName, - env, oAuthClient, }: { id: string; displayName: string; - env: Env; oAuthClient: OAuthClient; }) { return { id, displayName, - env, oAuthClient, }; } diff --git a/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/discord.ts b/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/discord.ts index 52e396f7a6..f8799170ca 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/discord.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/discord.ts @@ -1,17 +1,12 @@ {{={= =}=}} -import { Discord } from "arctic"; +import { Discord } from 'arctic'; -import { defineProvider } from "../provider.js"; -import { ensureEnvVarsForProvider } from "../env.js"; -import { getRedirectUriForCallback } from "../redirect.js"; +import { defineProvider } from '../provider.js'; +import { getRedirectUriForCallback } from '../redirect.js'; +import { env } from '../../../env.js'; -const id = "{= providerId =}"; -const displayName = "{= displayName =}"; - -const env = ensureEnvVarsForProvider( - ["DISCORD_CLIENT_ID", "DISCORD_CLIENT_SECRET"], - displayName -); +const id = '{= providerId =}'; +const displayName = '{= displayName =}'; const oAuthClient = new Discord( env.DISCORD_CLIENT_ID, @@ -23,6 +18,5 @@ const oAuthClient = new Discord( export const discord = defineProvider({ id, displayName, - env, oAuthClient, }); diff --git a/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/github.ts b/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/github.ts index e9c5019c37..604946dce5 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/github.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/github.ts @@ -1,16 +1,11 @@ {{={= =}=}} -import { GitHub } from "arctic"; +import { GitHub } from 'arctic'; -import { ensureEnvVarsForProvider } from "../env.js"; -import { defineProvider } from "../provider.js"; +import { defineProvider } from '../provider.js'; +import { env } from '../../../env.js'; -const id = "{= providerId =}"; -const displayName = "{= displayName =}"; - -const env = ensureEnvVarsForProvider( - ["GITHUB_CLIENT_ID", "GITHUB_CLIENT_SECRET"], - displayName -); +const id = '{= providerId =}'; +const displayName = '{= displayName =}'; const oAuthClient = new GitHub( env.GITHUB_CLIENT_ID, @@ -21,6 +16,5 @@ const oAuthClient = new GitHub( export const github = defineProvider({ id, displayName, - env, oAuthClient, }); diff --git a/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/google.ts b/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/google.ts index cf157ae12b..4fc8ceaa47 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/google.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/google.ts @@ -1,17 +1,12 @@ {{={= =}=}} -import { Google } from "arctic"; +import { Google } from 'arctic'; -import { ensureEnvVarsForProvider } from "../env.js"; -import { getRedirectUriForCallback } from "../redirect.js"; -import { defineProvider } from "../provider.js"; +import { getRedirectUriForCallback } from '../redirect.js'; +import { defineProvider } from '../provider.js'; +import { env } from '../../../env.js'; -const id = "{= providerId =}"; -const displayName = "{= displayName =}"; - -const env = ensureEnvVarsForProvider( - ["GOOGLE_CLIENT_ID", "GOOGLE_CLIENT_SECRET"], - displayName, -); +const id = '{= providerId =}'; +const displayName = '{= displayName =}'; const oAuthClient = new Google( env.GOOGLE_CLIENT_ID, @@ -23,6 +18,5 @@ const oAuthClient = new Google( export const google = defineProvider({ id, displayName, - env, oAuthClient, }); diff --git a/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/keycloak.ts b/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/keycloak.ts index 93136732d9..003d5aba62 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/keycloak.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/keycloak.ts @@ -1,17 +1,12 @@ {{={= =}=}} -import { Keycloak } from "arctic"; +import { Keycloak } from 'arctic'; -import { ensureEnvVarsForProvider } from "../env.js"; -import { getRedirectUriForCallback } from "../redirect.js"; -import { defineProvider } from "../provider.js"; +import { getRedirectUriForCallback } from '../redirect.js'; +import { defineProvider } from '../provider.js'; +import { env } from '../../../env.js'; -const id = "{= providerId =}"; -const displayName = "{= displayName =}"; - -const env = ensureEnvVarsForProvider( - ["KEYCLOAK_REALM_URL", "KEYCLOAK_CLIENT_ID", "KEYCLOAK_CLIENT_SECRET"], - displayName, -); +const id = '{= providerId =}'; +const displayName = '{= displayName =}'; const oAuthClient = new Keycloak( env.KEYCLOAK_REALM_URL, @@ -24,6 +19,5 @@ const oAuthClient = new Keycloak( export const keycloak = defineProvider({ id, displayName, - env, oAuthClient, }); diff --git a/waspc/data/Generator/templates/sdk/wasp/server/config.ts b/waspc/data/Generator/templates/sdk/wasp/server/config.ts index 01f9622c08..1f6b94a258 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/config.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/config.ts @@ -1,94 +1,47 @@ {{={= =}=}} -import merge from 'lodash.merge' +import { env } from './env.js' +import { stripTrailingSlash } from '../universal/url.js' -import { stripTrailingSlash } from "../universal/url.js"; +type NodeEnv = typeof env.NODE_ENV -const nodeEnv = process.env.NODE_ENV ?? 'development' - -// TODO: -// - Use dotenv library to consume env vars from a file. -// - Use convict library to define schema and validate env vars. -// https://codingsans.com/blog/node-config-best-practices - -type BaseConfig = { +type Config = { + env: NodeEnv; + isDevelopment: boolean; + port: number; + databaseUrl: string; + frontendUrl: string; + serverUrl: string; allowedCORSOrigins: string | string[]; {=# isAuthEnabled =} auth: { - jwtSecret: string | undefined; + jwtSecret: string; } {=/ isAuthEnabled =} } -type CommonConfig = BaseConfig & { - env: string; - isDevelopment: boolean; - port: number; - databaseUrl: string | undefined; -} +const frontendUrl = stripTrailingSlash(env.WASP_WEB_CLIENT_URL) +const serverUrl = stripTrailingSlash(env.WASP_SERVER_URL) -type EnvConfig = BaseConfig & { - frontendUrl: string; - serverUrl: string; +const allowedCORSOriginsPerEnv: Record = { + development: '*', + production: [frontendUrl] } - -type Config = CommonConfig & EnvConfig - -const config: { - all: CommonConfig, - development: EnvConfig, - production: EnvConfig, -} = { - all: { - env: nodeEnv, - isDevelopment: nodeEnv === 'development', - port: process.env.PORT ? parseInt(process.env.PORT) : {= defaultServerPort =}, - databaseUrl: process.env.{= databaseUrlEnvVarName =}, - allowedCORSOrigins: [], - {=# isAuthEnabled =} - auth: { - jwtSecret: undefined - } - {=/ isAuthEnabled =} - }, - development: getDevelopmentConfig(), - production: getProductionConfig(), -} - -const resolvedConfig: Config = merge(config.all, config[nodeEnv]) -// PUBLIC API -export default resolvedConfig - -function getDevelopmentConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL ?? '{= defaultClientUrl =}'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL ?? '{= defaultServerUrl =}'); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - allowedCORSOrigins: '*', - {=# isAuthEnabled =} - auth: { - jwtSecret: 'DEVJWTSECRET' - } - {=/ isAuthEnabled =} +const allowedCORSOrigins = allowedCORSOriginsPerEnv[env.NODE_ENV] + +const config: Config = { + frontendUrl, + serverUrl, + allowedCORSOrigins, + env: env.NODE_ENV, + isDevelopment: env.NODE_ENV === 'development', + port: env.PORT, + databaseUrl: env.{= databaseUrlEnvVarName =}, + {=# isAuthEnabled =} + auth: { + jwtSecret: env.JWT_SECRET } + {=/ isAuthEnabled =} } -function getProductionConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - // @ts-ignore - allowedCORSOrigins: [frontendUrl], - {=# isAuthEnabled =} - auth: { - jwtSecret: process.env.JWT_SECRET - } - {=/ isAuthEnabled =} - } -} +// PUBLIC API +export default config diff --git a/waspc/data/Generator/templates/sdk/wasp/server/email/core/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/email/core/index.ts index 746cd023e3..b772a30b46 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/email/core/index.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/email/core/index.ts @@ -1,17 +1,17 @@ {{={= =}=}} -{=# isSmtpProviderUsed =} +{=# isSmtpProviderEnabled =} // PRIVATE API export { initSmtpEmailSender as initEmailSender } from "./providers/smtp.js"; -{=/ isSmtpProviderUsed =} -{=# isSendGridProviderUsed =} +{=/ isSmtpProviderEnabled =} +{=# isSendGridProviderEnabled =} // PRIVATE API export { initSendGridEmailSender as initEmailSender } from "./providers/sendgrid.js"; -{=/ isSendGridProviderUsed =} -{=# isMailgunProviderUsed =} +{=/ isSendGridProviderEnabled =} +{=# isMailgunProviderEnabled =} // PRIVATE API export { initMailgunEmailSender as initEmailSender } from "./providers/mailgun.js"; -{=/ isMailgunProviderUsed =} -{=# isDummyProviderUsed =} +{=/ isMailgunProviderEnabled =} +{=# isDummyProviderEnabled =} // PRIVATE API export { initDummyEmailSender as initEmailSender } from "./providers/dummy.js"; -{=/ isDummyProviderUsed =} +{=/ isDummyProviderEnabled =} diff --git a/waspc/data/Generator/templates/sdk/wasp/server/email/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/email/index.ts index 41a30c8871..660740afa1 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/email/index.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/email/index.ts @@ -1,37 +1,36 @@ {{={= =}=}} +import { env } from '../env.js'; import { initEmailSender } from "./core/index.js"; import { EmailSender } from "./core/types.js"; -// TODO: We need to validate all the env variables -// For now, we are letting the runtime throw if they are not provided -{=# isSmtpProviderUsed =} +{=# isSmtpProviderEnabled =} const emailProvider = { type: "smtp", - host: process.env.SMTP_HOST!, - port: parseInt(process.env.SMTP_PORT!, 10), - username: process.env.SMTP_USERNAME!, - password: process.env.SMTP_PASSWORD!, + host: env.SMTP_HOST, + port: env.SMTP_PORT, + username: env.SMTP_USERNAME, + password: env.SMTP_PASSWORD, } as const; -{=/ isSmtpProviderUsed =} -{=# isSendGridProviderUsed =} +{=/ isSmtpProviderEnabled =} +{=# isSendGridProviderEnabled =} const emailProvider = { type: "sendgrid", - apiKey: process.env.SENDGRID_API_KEY!, + apiKey: env.SENDGRID_API_KEY, } as const; -{=/ isSendGridProviderUsed =} -{=# isMailgunProviderUsed =} +{=/ isSendGridProviderEnabled =} +{=# isMailgunProviderEnabled =} const emailProvider = { type: "mailgun", - apiKey: process.env.MAILGUN_API_KEY!, - domain: process.env.MAILGUN_DOMAIN!, - apiUrl: process.env.MAILGUN_API_URL!, + apiKey: env.MAILGUN_API_KEY, + domain: env.MAILGUN_DOMAIN, + apiUrl: env.MAILGUN_API_URL, } as const; -{=/ isMailgunProviderUsed =} -{=# isDummyProviderUsed =} +{=/ isMailgunProviderEnabled =} +{=# isDummyProviderEnabled =} const emailProvider = { type: "dummy", } as const; -{=/ isDummyProviderUsed =} +{=/ isDummyProviderEnabled =} // PUBLIC API export const emailSender: EmailSender = initEmailSender(emailProvider); diff --git a/waspc/data/Generator/templates/sdk/wasp/server/env.ts b/waspc/data/Generator/templates/sdk/wasp/server/env.ts new file mode 100644 index 0000000000..94efc3b60f --- /dev/null +++ b/waspc/data/Generator/templates/sdk/wasp/server/env.ts @@ -0,0 +1,157 @@ +{{={= =}=}} +import * as z from 'zod' + +import { ensureEnvSchema } from '../env/validation.js' + +{=# envValidationSchema.isDefined =} +{=& envValidationSchema.importStatement =} +const userServerEnvSchema = {= envValidationSchema.importIdentifier =} +{=/ envValidationSchema.isDefined =} +{=^ envValidationSchema.isDefined =} +const userServerEnvSchema = z.object({}) +{=/ envValidationSchema.isDefined =} + +const waspServerCommonSchema = z.object({ + PORT: z.coerce.number().default({= defaultServerPort =}), + {= databaseUrlEnvVarName =}: z.string({ + required_error: '{= databaseUrlEnvVarName =} is required', + }), + PG_BOSS_NEW_OPTIONS: z.string().optional(), + {=# isEmailSenderEnabled =} + {=# enabledEmailSenders.isSmtpProviderEnabled =} + SMTP_HOST: z.string({ + required_error: getRequiredEnvVarErrorMessage('SMTP email sender', 'SMTP_HOST'), + }), + SMTP_PORT: z.coerce.number({ + required_error: getRequiredEnvVarErrorMessage('SMTP email sender', 'SMTP_PORT'), + invalid_type_error: 'SMTP_PORT must be a number', + }), + SMTP_USERNAME: z.string({ + required_error: getRequiredEnvVarErrorMessage('SMTP email sender', 'SMTP_USERNAME'), + }), + SMTP_PASSWORD: z.string({ + required_error: getRequiredEnvVarErrorMessage('SMTP email sender', 'SMTP_PASSWORD'), + }), + {=/ enabledEmailSenders.isSmtpProviderEnabled =} + {=# enabledEmailSenders.isSendGridProviderEnabled =} + SENDGRID_API_KEY: z.string({ + required_error: getRequiredEnvVarErrorMessage('SendGrid email sender', 'SENDGRID_API_KEY'), + }), + {=/ enabledEmailSenders.isSendGridProviderEnabled =} + {=# enabledEmailSenders.isMailgunProviderEnabled =} + MAILGUN_API_KEY: z.string({ + required_error: getRequiredEnvVarErrorMessage('Mailgun email sender', 'MAILGUN_API_KEY'), + }), + MAILGUN_DOMAIN: z.string({ + required_error: getRequiredEnvVarErrorMessage('Mailgun email sender', 'MAILGUN_DOMAIN'), + }), + MAILGUN_API_URL: z.string().optional(), + {=/ enabledEmailSenders.isMailgunProviderEnabled =} + {=/ isEmailSenderEnabled =} + SKIP_EMAIL_VERIFICATION_IN_DEV: z + .enum(['true', 'false'], { + message: 'SKIP_EMAIL_VERIFICATION_IN_DEV must be either "true" or "false"', + }) + .transform((value) => value === 'true') + .default('false'), + {=# isAuthEnabled =} + {=# enabledAuthProviders.isGoogleAuthEnabled =} + GOOGLE_CLIENT_ID: z.string({ + required_error: getRequiredEnvVarErrorMessage('Google auth provider', 'GOOGLE_CLIENT_ID'), + }), + GOOGLE_CLIENT_SECRET: z.string({ + required_error: getRequiredEnvVarErrorMessage('Google auth provider', 'GOOGLE_CLIENT_SECRET'), + }), + {=/ enabledAuthProviders.isGoogleAuthEnabled =} + {=# enabledAuthProviders.isGitHubAuthEnabled =} + GITHUB_CLIENT_ID: z.string({ + required_error: getRequiredEnvVarErrorMessage('GitHub auth provider', 'GITHUB_CLIENT_ID'), + }), + GITHUB_CLIENT_SECRET: z.string({ + required_error: getRequiredEnvVarErrorMessage('GitHub auth provider', 'GITHUB_CLIENT_SECRET'), + }), + {=/ enabledAuthProviders.isGitHubAuthEnabled =} + {=# enabledAuthProviders.isDiscordAuthEnabled =} + DISCORD_CLIENT_ID: z.string({ + required_error: getRequiredEnvVarErrorMessage('Discord auth provider', 'DISCORD_CLIENT_ID'), + }), + DISCORD_CLIENT_SECRET: z.string({ + required_error: getRequiredEnvVarErrorMessage('Discord auth provider', 'DISCORD_CLIENT_SECRET'), + }), + {=/ enabledAuthProviders.isDiscordAuthEnabled =} + {=# enabledAuthProviders.isKeycloakAuthEnabled =} + KEYCLOAK_CLIENT_ID: z.string({ + required_error: getRequiredEnvVarErrorMessage('Keycloak auth provider', 'KEYCLOAK_CLIENT_ID'), + }), + KEYCLOAK_CLIENT_SECRET: z.string({ + required_error: getRequiredEnvVarErrorMessage('Keycloak auth provider', 'KEYCLOAK_CLIENT_SECRET'), + }), + KEYCLOAK_REALM_URL: z + .string({ + required_error: getRequiredEnvVarErrorMessage('Keycloak auth provider', 'KEYCLOAK_REALM_URL'), + }) + .url({ + message: 'KEYCLOAK_REALM_URL must be a valid URL', + }), + {=/ enabledAuthProviders.isKeycloakAuthEnabled =} + {=/ isAuthEnabled =} +}) + +const serverUrlSchema = z + .string({ + required_error: 'WASP_SERVER_URL is required', + }) + .url({ + message: 'WASP_SERVER_URL must be a valid URL', + }) + +const clientUrlSchema = z + .string({ + required_error: 'WASP_WEB_CLIENT_URL is required', + }) + .url({ + message: 'WASP_WEB_CLIENT_URL must be a valid URL', + }) + +{=# isAuthEnabled =} +const jwtTokenSchema = z + .string({ + required_error: 'JWT_SECRET is required', + }) +{=/ isAuthEnabled =} + +// In development, we provide default values for some environment variables +// to make the development process easier. +const serverDevSchema = z.object({ + NODE_ENV: z.literal('development'), + WASP_SERVER_URL: serverUrlSchema + .default('{= defaultServerUrl =}'), + WASP_WEB_CLIENT_URL: clientUrlSchema + .default('{= defaultClientUrl =}'), + {=# isAuthEnabled =} + JWT_SECRET: jwtTokenSchema + .default('DEVJWTSECRET'), + {=/ isAuthEnabled =} +}) + +const serverProdSchema = z.object({ + NODE_ENV: z.literal('production'), + WASP_SERVER_URL: serverUrlSchema, + WASP_WEB_CLIENT_URL: clientUrlSchema, + {=# isAuthEnabled =} + JWT_SECRET: jwtTokenSchema, + {=/ isAuthEnabled =} +}) + +const serverCommonSchema = userServerEnvSchema.merge(waspServerCommonSchema) +const serverEnvSchema = z.discriminatedUnion('NODE_ENV', [ + serverDevSchema.merge(serverCommonSchema), + serverProdSchema.merge(serverCommonSchema) +]) + +// PUBLIC API +export const env = ensureEnvSchema(process.env, serverEnvSchema) + +function getRequiredEnvVarErrorMessage(featureName: string, envVarName: string) { + return `${envVarName} is required when using ${featureName}` +} diff --git a/waspc/data/Generator/templates/sdk/wasp/server/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/index.ts index 535077900b..0f95deb90a 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/index.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/index.ts @@ -10,6 +10,8 @@ export { type ServerSetupFn } from './types/index.js' export { HttpError } from './HttpError.js' // PUBLIC API export { MiddlewareConfigFn } from './middleware/index.js' +// PUBLIC API +export { env } from './env.js' // PUBLIC API export type DbSeedFn = (prisma: PrismaClient) => Promise diff --git a/waspc/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts b/waspc/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts index a48992aad0..eed0cf23cc 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts @@ -1,5 +1,5 @@ import PgBoss from 'pg-boss' -import { config } from 'wasp/server' +import { config, env } from '../../../index.js' const boss = createPgBoss() @@ -9,9 +9,9 @@ function createPgBoss() { } // Add an escape hatch for advanced configuration of pg-boss to overwrite our defaults. - if (process.env.PG_BOSS_NEW_OPTIONS) { + if (env.PG_BOSS_NEW_OPTIONS) { try { - pgBossNewOptions = JSON.parse(process.env.PG_BOSS_NEW_OPTIONS) + pgBossNewOptions = JSON.parse(env.PG_BOSS_NEW_OPTIONS) } catch { console.error( 'Environment variable PG_BOSS_NEW_OPTIONS was not parsable by JSON.parse()!' diff --git a/waspc/data/Generator/templates/sdk/wasp/universal/url.ts b/waspc/data/Generator/templates/sdk/wasp/universal/url.ts index d21c06c65c..126678dac9 100644 --- a/waspc/data/Generator/templates/sdk/wasp/universal/url.ts +++ b/waspc/data/Generator/templates/sdk/wasp/universal/url.ts @@ -1,3 +1,5 @@ +export function stripTrailingSlash(url: string): string +export function stripTrailingSlash(url: undefined): undefined export function stripTrailingSlash(url?: string): string | undefined { return url?.replace(/\/$/, ""); } diff --git a/waspc/data/Generator/templates/server/package.json b/waspc/data/Generator/templates/server/package.json index 24d7a2c1a7..14f6464bbe 100644 --- a/waspc/data/Generator/templates/server/package.json +++ b/waspc/data/Generator/templates/server/package.json @@ -7,10 +7,9 @@ "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", - "start": "npm run validate-env && node --enable-source-maps -r dotenv/config bundle/server.js", + "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'", - "validate-env": "node -r dotenv/config ./scripts/validate-env.mjs", "db-seed": "npm run bundle && node --enable-source-maps -r dotenv/config bundle/dbSeed.js", "db-migrate-prod": "prisma migrate deploy --schema=../db/schema.prisma", "start-production": "{=& startProductionScript =}" diff --git a/waspc/data/Generator/templates/server/scripts/validate-env.mjs b/waspc/data/Generator/templates/server/scripts/validate-env.mjs deleted file mode 100644 index f6e50aceca..0000000000 --- a/waspc/data/Generator/templates/server/scripts/validate-env.mjs +++ /dev/null @@ -1,5 +0,0 @@ -import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; - -console.info("🔍 Validating environment variables..."); -throwIfNotValidAbsoluteURL(process.env.WASP_WEB_CLIENT_URL, 'Environment variable WASP_WEB_CLIENT_URL'); -throwIfNotValidAbsoluteURL(process.env.WASP_SERVER_URL, 'Environment variable WASP_SERVER_URL'); diff --git a/waspc/data/Generator/templates/server/src/auth/providers/config/email.ts b/waspc/data/Generator/templates/server/src/auth/providers/config/email.ts index a350e07b00..a0ba47d756 100644 --- a/waspc/data/Generator/templates/server/src/auth/providers/config/email.ts +++ b/waspc/data/Generator/templates/server/src/auth/providers/config/email.ts @@ -11,6 +11,7 @@ import { resetPassword } from "../email/resetPassword.js"; import { verifyEmail } from "../email/verifyEmail.js"; import { GetVerificationEmailContentFn, GetPasswordResetEmailContentFn } from "wasp/server/auth/email"; import { handleRejection } from "wasp/server/utils"; +import { env } from "wasp/server"; {=# userSignupFields.isDefined =} {=& userSignupFields.importStatement =} @@ -70,7 +71,7 @@ const config: ProviderConfig = { clientRoute: '{= emailVerificationClientRoute =}', getVerificationEmailContent: _waspGetVerificationEmailContent, {=# isDevelopment =} - isEmailAutoVerified: process.env.SKIP_EMAIL_VERIFICATION_IN_DEV === 'true', + isEmailAutoVerified: env.SKIP_EMAIL_VERIFICATION_IN_DEV, {=/ isDevelopment =} {=^ isDevelopment =} isEmailAutoVerified: false, diff --git a/waspc/data/Generator/templates/server/src/auth/providers/config/keycloak.ts b/waspc/data/Generator/templates/server/src/auth/providers/config/keycloak.ts index f80d56ad46..8bcacd390c 100644 --- a/waspc/data/Generator/templates/server/src/auth/providers/config/keycloak.ts +++ b/waspc/data/Generator/templates/server/src/auth/providers/config/keycloak.ts @@ -2,6 +2,7 @@ import type { ProviderConfig } from "wasp/auth/providers/types"; import { keycloak } from "wasp/server/auth"; +import { env } from "wasp/server"; import { mergeDefaultAndUserConfig } from "../oauth/config.js"; import { createOAuthProviderRouter } from "../oauth/handler.js"; @@ -32,7 +33,7 @@ const _waspConfig: ProviderConfig = { providerProfile: unknown; providerUserId: string; }> { - const userInfoEndpoint = `${keycloak.env.KEYCLOAK_REALM_URL}/protocol/openid-connect/userinfo`; + const userInfoEndpoint = `${env.KEYCLOAK_REALM_URL}/protocol/openid-connect/userinfo`; const response = await fetch( userInfoEndpoint, { diff --git a/waspc/data/Generator/templates/server/src/auth/providers/oauth/cookies.ts b/waspc/data/Generator/templates/server/src/auth/providers/oauth/cookies.ts index 10fdd63984..b398c2e40d 100644 --- a/waspc/data/Generator/templates/server/src/auth/providers/oauth/cookies.ts +++ b/waspc/data/Generator/templates/server/src/auth/providers/oauth/cookies.ts @@ -1,10 +1,11 @@ import { Request as ExpressRequest, Response as ExpressResponse, -} from "express"; -import { parseCookies } from "oslo/cookie"; +} from 'express'; +import { parseCookies } from 'oslo/cookie'; -import type { ProviderConfig } from "wasp/auth/providers/types"; +import type { ProviderConfig } from 'wasp/auth/providers/types'; +import { config } from 'wasp/server'; import type { OAuthStateFieldName } from './state'; @@ -17,8 +18,7 @@ export function setOAuthCookieValue( const cookieName = `${provider.id}_${fieldName}`; res.cookie(cookieName, value, { httpOnly: true, - // TODO: use server config to determine if secure - secure: process.env.NODE_ENV === "production", + secure: !config.isDevelopment, path: "/", maxAge: 60 * 60 * 1000, // 1 hour }); diff --git a/waspc/data/Generator/templates/server/src/polyfill.ts b/waspc/data/Generator/templates/server/src/polyfill.ts index 7931d12eb0..9279daf6da 100644 --- a/waspc/data/Generator/templates/server/src/polyfill.ts +++ b/waspc/data/Generator/templates/server/src/polyfill.ts @@ -1,11 +1,10 @@ // This is a polyfill for Node.js 18 webcrypto API so Lucia can use it // for random number generation. -import { webcrypto } from "node:crypto"; +import { webcrypto } from 'node:crypto' // NOTE: node < 19 doesn't have Crypto API, which we need for Lucia, so we apply the polyfill if Crypto API is not defined. -if (typeof globalThis.crypto === "undefined") { +if (typeof globalThis.crypto === 'undefined') { // @ts-ignore - globalThis.crypto = webcrypto as Crypto; + globalThis.crypto = webcrypto as Crypto } - diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest b/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest index 55670c2900..5a02bbe90a 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest @@ -7,6 +7,7 @@ waspBuild/.wasp/build/package.json waspBuild/.wasp/build/sdk/wasp/api/events.ts waspBuild/.wasp/build/sdk/wasp/api/index.ts waspBuild/.wasp/build/sdk/wasp/client/config.ts +waspBuild/.wasp/build/sdk/wasp/client/env.ts waspBuild/.wasp/build/sdk/wasp/client/index.ts waspBuild/.wasp/build/sdk/wasp/client/operations/actions/core.ts waspBuild/.wasp/build/sdk/wasp/client/operations/actions/index.ts @@ -36,6 +37,9 @@ waspBuild/.wasp/build/sdk/wasp/dist/api/index.js.map waspBuild/.wasp/build/sdk/wasp/dist/client/config.d.ts waspBuild/.wasp/build/sdk/wasp/dist/client/config.js waspBuild/.wasp/build/sdk/wasp/dist/client/config.js.map +waspBuild/.wasp/build/sdk/wasp/dist/client/env.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/client/env.js +waspBuild/.wasp/build/sdk/wasp/dist/client/env.js.map waspBuild/.wasp/build/sdk/wasp/dist/client/index.d.ts waspBuild/.wasp/build/sdk/wasp/dist/client/index.js waspBuild/.wasp/build/sdk/wasp/dist/client/index.js.map @@ -99,6 +103,12 @@ waspBuild/.wasp/build/sdk/wasp/dist/dev/index.js.map waspBuild/.wasp/build/sdk/wasp/dist/entities/index.d.ts waspBuild/.wasp/build/sdk/wasp/dist/entities/index.js waspBuild/.wasp/build/sdk/wasp/dist/entities/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/env/index.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/env/index.js +waspBuild/.wasp/build/sdk/wasp/dist/env/index.js.map +waspBuild/.wasp/build/sdk/wasp/dist/env/validation.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/env/validation.js +waspBuild/.wasp/build/sdk/wasp/dist/env/validation.js.map waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.d.ts waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.jsx waspBuild/.wasp/build/sdk/wasp/dist/ext-src/MainPage.jsx.map @@ -120,6 +130,9 @@ waspBuild/.wasp/build/sdk/wasp/dist/server/config.js.map waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.d.ts waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.js waspBuild/.wasp/build/sdk/wasp/dist/server/dbClient.js.map +waspBuild/.wasp/build/sdk/wasp/dist/server/env.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/server/env.js +waspBuild/.wasp/build/sdk/wasp/dist/server/env.js.map waspBuild/.wasp/build/sdk/wasp/dist/server/index.d.ts waspBuild/.wasp/build/sdk/wasp/dist/server/index.js waspBuild/.wasp/build/sdk/wasp/dist/server/index.js.map @@ -166,6 +179,8 @@ waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.d.ts waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.js waspBuild/.wasp/build/sdk/wasp/dist/universal/validators.js.map waspBuild/.wasp/build/sdk/wasp/entities/index.ts +waspBuild/.wasp/build/sdk/wasp/env/index.ts +waspBuild/.wasp/build/sdk/wasp/env/validation.ts waspBuild/.wasp/build/sdk/wasp/ext-src/Main.css waspBuild/.wasp/build/sdk/wasp/ext-src/MainPage.jsx waspBuild/.wasp/build/sdk/wasp/ext-src/vite-env.d.ts @@ -178,6 +193,7 @@ waspBuild/.wasp/build/sdk/wasp/server/_types/serialization.ts waspBuild/.wasp/build/sdk/wasp/server/_types/taggedEntities.ts waspBuild/.wasp/build/sdk/wasp/server/config.ts waspBuild/.wasp/build/sdk/wasp/server/dbClient.ts +waspBuild/.wasp/build/sdk/wasp/server/env.ts waspBuild/.wasp/build/sdk/wasp/server/index.ts waspBuild/.wasp/build/sdk/wasp/server/middleware/globalMiddleware.ts waspBuild/.wasp/build/sdk/wasp/server/middleware/index.ts @@ -200,7 +216,6 @@ waspBuild/.wasp/build/server/README.md waspBuild/.wasp/build/server/nodemon.json waspBuild/.wasp/build/server/package.json waspBuild/.wasp/build/server/rollup.config.js -waspBuild/.wasp/build/server/scripts/validate-env.mjs waspBuild/.wasp/build/server/src/app.js waspBuild/.wasp/build/server/src/middleware/globalMiddleware.ts waspBuild/.wasp/build/server/src/middleware/index.ts @@ -222,7 +237,6 @@ waspBuild/.wasp/build/web-app/package.json waspBuild/.wasp/build/web-app/public/.gitkeep waspBuild/.wasp/build/web-app/public/favicon.ico waspBuild/.wasp/build/web-app/public/manifest.json -waspBuild/.wasp/build/web-app/scripts/validate-env.mjs waspBuild/.wasp/build/web-app/src/components/DefaultRootErrorBoundary.tsx waspBuild/.wasp/build/web-app/src/components/FullPageWrapper.tsx waspBuild/.wasp/build/web-app/src/components/Loader.module.css @@ -240,6 +254,7 @@ waspBuild/.wasp/build/web-app/vite.config.ts waspBuild/.wasp/out/sdk/wasp/api/events.ts waspBuild/.wasp/out/sdk/wasp/api/index.ts waspBuild/.wasp/out/sdk/wasp/client/config.ts +waspBuild/.wasp/out/sdk/wasp/client/env.ts waspBuild/.wasp/out/sdk/wasp/client/index.ts waspBuild/.wasp/out/sdk/wasp/client/operations/actions/core.ts waspBuild/.wasp/out/sdk/wasp/client/operations/actions/index.ts @@ -269,6 +284,9 @@ waspBuild/.wasp/out/sdk/wasp/dist/api/index.js.map waspBuild/.wasp/out/sdk/wasp/dist/client/config.d.ts waspBuild/.wasp/out/sdk/wasp/dist/client/config.js waspBuild/.wasp/out/sdk/wasp/dist/client/config.js.map +waspBuild/.wasp/out/sdk/wasp/dist/client/env.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/client/env.js +waspBuild/.wasp/out/sdk/wasp/dist/client/env.js.map waspBuild/.wasp/out/sdk/wasp/dist/client/index.d.ts waspBuild/.wasp/out/sdk/wasp/dist/client/index.js waspBuild/.wasp/out/sdk/wasp/dist/client/index.js.map @@ -332,6 +350,12 @@ waspBuild/.wasp/out/sdk/wasp/dist/dev/index.js.map waspBuild/.wasp/out/sdk/wasp/dist/entities/index.d.ts waspBuild/.wasp/out/sdk/wasp/dist/entities/index.js waspBuild/.wasp/out/sdk/wasp/dist/entities/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/env/index.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/env/index.js +waspBuild/.wasp/out/sdk/wasp/dist/env/index.js.map +waspBuild/.wasp/out/sdk/wasp/dist/env/validation.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/env/validation.js +waspBuild/.wasp/out/sdk/wasp/dist/env/validation.js.map waspBuild/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts waspBuild/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx waspBuild/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map @@ -353,6 +377,9 @@ waspBuild/.wasp/out/sdk/wasp/dist/server/config.js.map waspBuild/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts waspBuild/.wasp/out/sdk/wasp/dist/server/dbClient.js waspBuild/.wasp/out/sdk/wasp/dist/server/dbClient.js.map +waspBuild/.wasp/out/sdk/wasp/dist/server/env.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/server/env.js +waspBuild/.wasp/out/sdk/wasp/dist/server/env.js.map waspBuild/.wasp/out/sdk/wasp/dist/server/index.d.ts waspBuild/.wasp/out/sdk/wasp/dist/server/index.js waspBuild/.wasp/out/sdk/wasp/dist/server/index.js.map @@ -399,6 +426,8 @@ waspBuild/.wasp/out/sdk/wasp/dist/universal/validators.d.ts waspBuild/.wasp/out/sdk/wasp/dist/universal/validators.js waspBuild/.wasp/out/sdk/wasp/dist/universal/validators.js.map waspBuild/.wasp/out/sdk/wasp/entities/index.ts +waspBuild/.wasp/out/sdk/wasp/env/index.ts +waspBuild/.wasp/out/sdk/wasp/env/validation.ts waspBuild/.wasp/out/sdk/wasp/ext-src/Main.css waspBuild/.wasp/out/sdk/wasp/ext-src/MainPage.jsx waspBuild/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts @@ -411,6 +440,7 @@ waspBuild/.wasp/out/sdk/wasp/server/_types/serialization.ts waspBuild/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts waspBuild/.wasp/out/sdk/wasp/server/config.ts waspBuild/.wasp/out/sdk/wasp/server/dbClient.ts +waspBuild/.wasp/out/sdk/wasp/server/env.ts waspBuild/.wasp/out/sdk/wasp/server/index.ts waspBuild/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts waspBuild/.wasp/out/sdk/wasp/server/middleware/index.ts 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 1508ffca4f..58f9e728a4 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 @@ -18,14 +18,21 @@ "file", "../out/sdk/wasp/client/config.ts" ], - "d94e8bee5fd8f6793b511652b9ee558e57f4913595763137a5385cd929648168" + "4c5835ad64352cc87a4a17e41fd70333bc0d1eedd7339d7ad3d3507cdb64038d" + ], + [ + [ + "file", + "../out/sdk/wasp/client/env.ts" + ], + "2a3602d40b299fbfa1a6275fe67828d5653d9f3265ba8204b75178aa41dcbae0" ], [ [ "file", "../out/sdk/wasp/client/index.ts" ], - "2b3651e7040a63cfd6a271c2aa89f21cf01170e0abeb6c5ab74adde324852fe4" + "b55e5c34c2fdb50e608bcb4331fa2e67724f1fbfb21e1b93680b0f5fe2b7005a" ], [ [ @@ -167,6 +174,20 @@ ], "c59b97b122b977b5171686c92ee5ff2d80d397c2e83cc0915affb6ee136406fb" ], + [ + [ + "file", + "../out/sdk/wasp/env/index.ts" + ], + "d92b4832e9d4249ae5b1f00c0f9760d6841aa44bc199550414793a1d57a6845e" + ], + [ + [ + "file", + "../out/sdk/wasp/env/validation.ts" + ], + "e22b2fb8931275d3b1bd3176cbdbf753d22fc61887ded0e93cd8febf1b97d260" + ], [ [ "file", @@ -200,7 +221,7 @@ "file", "../out/sdk/wasp/package.json" ], - "6f1afd30c951e1f49740256440cd626c9cb521cf0822d93d2d2a5d63d8719d7b" + "b991fb5ade61a662dea3f21bf09aa30379f30ea76204a369c0800b1413256a64" ], [ [ @@ -214,7 +235,7 @@ "file", "../out/sdk/wasp/server/HttpError.ts" ], - "f375fb45eeb16381b8cc575503db302c005ddaa1b35d837ca0ea043fe8ec6ccb" + "9c1b2449d8e9d68470c6014054a3c3074069a104ddb291b9089c30d624a2d9d9" ], [ [ @@ -242,7 +263,7 @@ "file", "../out/sdk/wasp/server/config.ts" ], - "5dd35660e0969defaa3c180179919f4922ab7bc041746872dff7f2280c1872ae" + "8431eaf0332cdbdd2f36b4c232b4b6b65fd19bad58fe51922f5b2662f22fc8ad" ], [ [ @@ -251,12 +272,19 @@ ], "50f11eb232174184be5fd44e8ee3875c30707b486c8c70c3f7bfb93609d38e66" ], + [ + [ + "file", + "../out/sdk/wasp/server/env.ts" + ], + "f3cab17868417ffd4432dc4efecde72ccaaf099a79ddc9194835f3608d123b63" + ], [ [ "file", "../out/sdk/wasp/server/index.ts" ], - "51c3e0802764f72b88f6daaf148dba514ae817e233a40cc9b92ec91784f71f98" + "a8d2ffa7dfd0a13f7fb6135193bcdac1f860603bdd0ddc2843033fd4f6f6151f" ], [ [ @@ -354,7 +382,7 @@ "file", "../out/sdk/wasp/universal/url.ts" ], - "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" + "58ff4ad8ffc79264d7215461571d909f3c5fb177ff32c67058d1da9cd4115d6e" ], [ [ @@ -382,7 +410,7 @@ "file", "Dockerfile" ], - "8851d4e81582d58921a5646dcf063b31dbf8ce9a46f3d4710360d2047dc644b5" + "20694e4dd2e7d96d8752ee3d792d4d8b63c46d7a4505c5312923a749146604b7" ], [ [ @@ -424,7 +452,7 @@ "file", "server/package.json" ], - "a4eb7e59ac5309fc5c39ccd7e19f4fdc7a9a568a3b393f62358ef6a6065d65c3" + "eaaa1e16e4962f38deb7220a7439a26b920ed7f852890242d084b4cebc63b7c3" ], [ [ @@ -433,13 +461,6 @@ ], "c1beb8264f11898364288d73b16f08d1923bac5f70038d9827978deb5b58a2da" ], - [ - [ - "file", - "server/scripts/validate-env.mjs" - ], - "100177b4326ccab7362eff378315d532ad1cc17cd28d1ed5978cb167fd627746" - ], [ [ "file", @@ -473,7 +494,7 @@ "file", "server/src/polyfill.ts" ], - "1149661e0aa7228b184bb2c04ac63232a6523b09b33829db6977f79daba3fd8d" + "f62c2088c8ebf5889ab479bb937ffd8f0f96d3e85483a7b088edebb5ae598dca" ], [ [ @@ -543,7 +564,7 @@ "file", "web-app/package.json" ], - "196b888bc57d79d1c32f4d3af30fbc32817afb983fa890c3749d4fcf92193a5b" + "f504812cc7092c09d8b7e25a4f783591e588211ace1e25aa56aaf20cc739f3e9" ], [ [ @@ -566,19 +587,12 @@ ], "696886c4dd2bb66df380e2a9ebf07d54fe39b25af968aeea090ed6fb528d402e" ], - [ - [ - "file", - "web-app/scripts/validate-env.mjs" - ], - "a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd" - ], [ [ "file", "web-app/src/components/DefaultRootErrorBoundary.tsx" ], - "4a141a28ca7aed9daddd75c156f7bae5eec50f3e5a85b6a43a28fa2648f34c44" + "73bbe8a2eb141e523c6b8169c0831e594b4ab6c7207f107d6d20c1561b44373a" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/Dockerfile b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/Dockerfile index 44152eecda..2c775ca6af 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/Dockerfile +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/Dockerfile @@ -50,15 +50,15 @@ WORKDIR /app # Copying the top level 'node_modules' because it contains the Prisma packages # necessary for migrating the database. COPY --from=server-builder /app/node_modules ./node_modules -# Copying the SDK because 'validate-env.mjs' executes independent of the bundle +# Copying the SDK because the server bundle doesn't bundle the SDK # and references the 'wasp' package. COPY --from=server-builder /app/.wasp/out/sdk .wasp/out/sdk -# Copying 'server/node_modules' because 'validate-env.mjs' executes independent -# of the bundle and references the dotenv package. +# Copying 'server/node_modules' because we require dotenv package to +# load environment variables +# TODO: replace dotenv with native Node.js environment variable loading COPY --from=server-builder /app/.wasp/build/server/node_modules .wasp/build/server/node_modules COPY --from=server-builder /app/.wasp/build/server/bundle .wasp/build/server/bundle COPY --from=server-builder /app/.wasp/build/server/package*.json .wasp/build/server/ -COPY --from=server-builder /app/.wasp/build/server/scripts .wasp/build/server/scripts COPY db/ .wasp/build/db/ EXPOSE ${PORT} WORKDIR /app/.wasp/build/server diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedNpmDepsLog.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedNpmDepsLog.json index a21ddcd4a1..d9bee4d2fa 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedNpmDepsLog.json +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/installedNpmDepsLog.json @@ -1 +1 @@ -{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.21.0"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^2.2.1"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"^16.0.2"},{"name":"express","version":"~4.21.0"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"superjson","version":"^2.2.1"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"}]}}} \ No newline at end of file +{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.21.0"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^2.2.1"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"},{"name":"zod","version":"^3.23.8"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"^16.0.2"},{"name":"express","version":"~4.21.0"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"superjson","version":"^2.2.1"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"}]}}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/config.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/config.ts index 82b0f80b6a..fff77cb01c 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/config.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/config.ts @@ -1,6 +1,7 @@ import { stripTrailingSlash } from '../universal/url.js' +import { env } from './env.js' -const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; +const apiUrl = stripTrailingSlash(env.REACT_APP_API_URL) // PUBLIC API export type ClientConfig = { diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/env.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/env.ts new file mode 100644 index 0000000000..8ddab287f7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/env.ts @@ -0,0 +1,18 @@ +import * as z from 'zod' + +import { ensureEnvSchema } from '../env/validation.js' + +const userClientEnvSchema = z.object({}) + +const waspClientEnvSchema = z.object({ + REACT_APP_API_URL: z + .string({ + required_error: 'REACT_APP_API_URL is required', + }) + .default('http://localhost:3001') +}) + +const clientEnvSchema = userClientEnvSchema.merge(waspClientEnvSchema) + +// PUBLIC API +export const env = ensureEnvSchema(import.meta.env, clientEnvSchema) diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/index.ts index cfce564c4d..859f8656b6 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/index.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/index.ts @@ -11,4 +11,7 @@ export enum HttpMethod { export type Route = { method: HttpMethod; path: string } // PUBLIC API -export { config, ClientConfig } from './config' +export { config, ClientConfig } from './config.js' + +// PUBLIC API +export { env } from './env.js' diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/config.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/config.js index 1dffbd68bc..7e6149f386 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/config.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/config.js @@ -1,5 +1,6 @@ import { stripTrailingSlash } from '../universal/url.js'; -const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; +import { env } from './env.js'; +const apiUrl = stripTrailingSlash(env.REACT_APP_API_URL); // PUBLIC API export const config = { apiUrl, diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/config.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/config.js.map index d26d37022b..f9e186b838 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/config.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAExD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;AAOxD,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/env.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/env.d.ts new file mode 100644 index 0000000000..5a9417a810 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/env.d.ts @@ -0,0 +1,3 @@ +export declare const env: { + REACT_APP_API_URL: string; +}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/env.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/env.js new file mode 100644 index 0000000000..91164c3768 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/env.js @@ -0,0 +1,14 @@ +import * as z from 'zod'; +import { ensureEnvSchema } from '../env/validation.js'; +const userClientEnvSchema = z.object({}); +const waspClientEnvSchema = z.object({ + REACT_APP_API_URL: z + .string({ + required_error: 'REACT_APP_API_URL is required', + }) + .default('http://localhost:3001') +}); +const clientEnvSchema = userClientEnvSchema.merge(waspClientEnvSchema); +// PUBLIC API +export const env = ensureEnvSchema(import.meta.env, clientEnvSchema); +//# sourceMappingURL=env.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/env.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/env.js.map new file mode 100644 index 0000000000..d230f15c0d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/env.js.map @@ -0,0 +1 @@ +{"version":3,"file":"env.js","sourceRoot":"","sources":["../../client/env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,iBAAiB,EAAE,CAAC;SACjB,MAAM,CAAC;QACN,cAAc,EAAE,+BAA+B;KAChD,CAAC;SACD,OAAO,CAAC,uBAAuB,CAAC;CACpC,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,mBAAmB,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;AAEtE,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.d.ts index 7f5f4bfbc8..6498c439bd 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.d.ts @@ -8,4 +8,5 @@ export type Route = { method: HttpMethod; path: string; }; -export { config, ClientConfig } from './config'; +export { config, ClientConfig } from './config.js'; +export { env } from './env.js'; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.js index 5a7f13dcae..2f4daa7ae3 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.js @@ -8,5 +8,7 @@ export var HttpMethod; HttpMethod["Delete"] = "DELETE"; })(HttpMethod || (HttpMethod = {})); // PUBLIC API -export { config } from './config'; +export { config } from './config.js'; +// PUBLIC API +export { env } from './env.js'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.js.map index 879953c8df..f3611558dc 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,MAAM,EAAgB,MAAM,UAAU,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,MAAM,EAAgB,MAAM,aAAa,CAAA;AAElD,aAAa;AACb,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/index.d.ts new file mode 100644 index 0000000000..d1dafc25fd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/index.d.ts @@ -0,0 +1,3 @@ +import * as z from 'zod'; +export declare function defineEnvValidationSchema>(schema: Schema): Schema; +export { ensureEnvSchema } from './validation.js'; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/index.js new file mode 100644 index 0000000000..17e695d087 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/index.js @@ -0,0 +1,7 @@ +// PUBLIC API +export function defineEnvValidationSchema(schema) { + return schema; +} +// PRIVATE API (SDK, Vite config) +export { ensureEnvSchema } from './validation.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/index.js.map new file mode 100644 index 0000000000..75b4ff7de3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../env/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,MAAM,UAAU,yBAAyB,CACvC,MAAc;IAEd,OAAO,MAAM,CAAA;AACf,CAAC;AAED,iCAAiC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/validation.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/validation.d.ts new file mode 100644 index 0000000000..6bc9d059a3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/validation.d.ts @@ -0,0 +1,2 @@ +import * as z from 'zod'; +export declare function ensureEnvSchema(data: unknown, schema: Schema): z.infer; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/validation.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/validation.js new file mode 100644 index 0000000000..8463eb578e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/validation.js @@ -0,0 +1,23 @@ +import * as z from 'zod'; +const redColor = '\x1b[31m'; +export function ensureEnvSchema(data, schema) { + try { + return schema.parse(data); + } + catch (e) { + if (e instanceof z.ZodError) { + const errorOutput = ['', '══ Env vars validation failed ══', '']; + for (const error of e.errors) { + errorOutput.push(` - ${error.message}`); + } + errorOutput.push(''); + errorOutput.push('════════════════════════════════'); + console.error(redColor, errorOutput.join('\n')); + throw new Error('Error parsing environment variables'); + } + else { + throw e; + } + } +} +//# sourceMappingURL=validation.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/validation.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/validation.js.map new file mode 100644 index 0000000000..1d57b14a0b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/env/validation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../env/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,MAAM,QAAQ,GAAG,UAAU,CAAA;AAE3B,MAAM,UAAU,eAAe,CAC7B,IAAa,EACb,MAAc;IAEd,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;YAC5B,MAAM,WAAW,GAAG,CAAC,EAAE,EAAE,kCAAkC,EAAE,EAAE,CAAC,CAAA;YAChE,KAAK,MAAM,KAAK,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;gBAC7B,WAAW,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;YACzC,CAAC;YACD,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACpB,WAAW,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAA;YACpD,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;YAC/C,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;QACxD,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,CAAA;QACT,CAAC;IACH,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js.map index 8163354e1b..462e1c1811 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js.map @@ -1 +1 @@ -{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,OAAsB;QACvG,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YACE,UAAkB,EAClB,OAAgB,EAChB,IAA8B,EAC9B,OAAsB;QAEtB,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IACE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EACxE,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.d.ts index 68bb448c56..70f438bdf0 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.d.ts @@ -1,16 +1,13 @@ -type BaseConfig = { - allowedCORSOrigins: string | string[]; -}; -type CommonConfig = BaseConfig & { - env: string; +import { env } from './env.js'; +type NodeEnv = typeof env.NODE_ENV; +type Config = { + env: NodeEnv; isDevelopment: boolean; port: number; - databaseUrl: string | undefined; -}; -type EnvConfig = BaseConfig & { + databaseUrl: string; frontendUrl: string; serverUrl: string; + allowedCORSOrigins: string | string[]; }; -type Config = CommonConfig & EnvConfig; -declare const resolvedConfig: Config; -export default resolvedConfig; +declare const config: Config; +export default config; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js index e4f89082c8..dcc80722ab 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js @@ -1,43 +1,21 @@ -var _a; -import merge from 'lodash.merge'; -import { stripTrailingSlash } from "../universal/url.js"; -const nodeEnv = (_a = process.env.NODE_ENV) !== null && _a !== void 0 ? _a : 'development'; +import { env } from './env.js'; +import { stripTrailingSlash } from '../universal/url.js'; +const frontendUrl = stripTrailingSlash(env.WASP_WEB_CLIENT_URL); +const serverUrl = stripTrailingSlash(env.WASP_SERVER_URL); +const allowedCORSOriginsPerEnv = { + development: '*', + production: [frontendUrl] +}; +const allowedCORSOrigins = allowedCORSOriginsPerEnv[env.NODE_ENV]; const config = { - all: { - env: nodeEnv, - isDevelopment: nodeEnv === 'development', - port: process.env.PORT ? parseInt(process.env.PORT) : 3001, - databaseUrl: process.env.DATABASE_URL, - allowedCORSOrigins: [], - }, - development: getDevelopmentConfig(), - production: getProductionConfig(), + frontendUrl, + serverUrl, + allowedCORSOrigins, + env: env.NODE_ENV, + isDevelopment: env.NODE_ENV === 'development', + port: env.PORT, + databaseUrl: env.DATABASE_URL, }; -const resolvedConfig = merge(config.all, config[nodeEnv]); // PUBLIC API -export default resolvedConfig; -function getDevelopmentConfig() { - var _a, _b; - const frontendUrl = stripTrailingSlash((_a = process.env.WASP_WEB_CLIENT_URL) !== null && _a !== void 0 ? _a : 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash((_b = process.env.WASP_SERVER_URL) !== null && _b !== void 0 ? _b : 'http://localhost:3001'); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - allowedCORSOrigins: '*', - }; -} -function getProductionConfig() { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - // @ts-ignore - allowedCORSOrigins: [frontendUrl], - }; -} +export default config; //# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js.map index e284580bbd..9fd077fa81 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,mCAAI,aAAa,CAAA;AAyBrD,MAAM,MAAM,GAIR;IACF,GAAG,EAAE;QACH,GAAG,EAAE,OAAO;QACZ,aAAa,EAAE,OAAO,KAAK,aAAa;QACxC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;QAC1D,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;KACvB;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;CAClC,CAAA;AAED,MAAM,cAAc,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACjE,aAAa;AACb,eAAe,cAAc,CAAA;AAE7B,SAAS,oBAAoB;;IAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,mBAAmB,mCAAI,wBAAwB,CAAC,CAAC;IACpG,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,eAAe,mCAAI,uBAAuB,CAAC,CAAC;IAC7F,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,kBAAkB,EAAE,GAAG;KACxB,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAClE,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,aAAa;QACb,kBAAkB,EAAE,CAAC,WAAW,CAAC;KAClC,CAAA;AACH,CAAC"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAcxD,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;AAC/D,MAAM,SAAS,GAAG,kBAAkB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;AAEzD,MAAM,wBAAwB,GAAuC;IACnE,WAAW,EAAE,GAAG;IAChB,UAAU,EAAE,CAAC,WAAW,CAAC;CAC1B,CAAA;AACD,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAEjE,MAAM,MAAM,GAAW;IACrB,WAAW;IACX,SAAS;IACT,kBAAkB;IAClB,GAAG,EAAE,GAAG,CAAC,QAAQ;IACjB,aAAa,EAAE,GAAG,CAAC,QAAQ,KAAK,aAAa;IAC7C,IAAI,EAAE,GAAG,CAAC,IAAI;IACd,WAAW,EAAE,GAAG,CAAC,YAAY;CAC9B,CAAA;AAED,aAAa;AACb,eAAe,MAAM,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/env.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/env.d.ts new file mode 100644 index 0000000000..667ea30e35 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/env.d.ts @@ -0,0 +1,17 @@ +export declare const env: { + PORT: number; + DATABASE_URL: string; + SKIP_EMAIL_VERIFICATION_IN_DEV: boolean; + NODE_ENV: "development"; + WASP_SERVER_URL: string; + WASP_WEB_CLIENT_URL: string; + PG_BOSS_NEW_OPTIONS?: string | undefined; +} | { + PORT: number; + DATABASE_URL: string; + SKIP_EMAIL_VERIFICATION_IN_DEV: boolean; + NODE_ENV: "production"; + WASP_SERVER_URL: string; + WASP_WEB_CLIENT_URL: string; + PG_BOSS_NEW_OPTIONS?: string | undefined; +}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/env.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/env.js new file mode 100644 index 0000000000..1bfc3e0b6e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/env.js @@ -0,0 +1,55 @@ +import * as z from 'zod'; +import { ensureEnvSchema } from '../env/validation.js'; +const userServerEnvSchema = z.object({}); +const waspServerCommonSchema = z.object({ + PORT: z.coerce.number().default(3001), + DATABASE_URL: z.string({ + required_error: 'DATABASE_URL is required', + }), + PG_BOSS_NEW_OPTIONS: z.string().optional(), + SKIP_EMAIL_VERIFICATION_IN_DEV: z + .enum(['true', 'false'], { + message: 'SKIP_EMAIL_VERIFICATION_IN_DEV must be either "true" or "false"', + }) + .transform((value) => value === 'true') + .default('false'), +}); +const serverUrlSchema = z + .string({ + required_error: 'WASP_SERVER_URL is required', +}) + .url({ + message: 'WASP_SERVER_URL must be a valid URL', +}); +const clientUrlSchema = z + .string({ + required_error: 'WASP_WEB_CLIENT_URL is required', +}) + .url({ + message: 'WASP_WEB_CLIENT_URL must be a valid URL', +}); +// In development, we provide default values for some environment variables +// to make the development process easier. +const serverDevSchema = z.object({ + NODE_ENV: z.literal('development'), + WASP_SERVER_URL: serverUrlSchema + .default('http://localhost:3001'), + WASP_WEB_CLIENT_URL: clientUrlSchema + .default('http://localhost:3000/'), +}); +const serverProdSchema = z.object({ + NODE_ENV: z.literal('production'), + WASP_SERVER_URL: serverUrlSchema, + WASP_WEB_CLIENT_URL: clientUrlSchema, +}); +const serverCommonSchema = userServerEnvSchema.merge(waspServerCommonSchema); +const serverEnvSchema = z.discriminatedUnion('NODE_ENV', [ + serverDevSchema.merge(serverCommonSchema), + serverProdSchema.merge(serverCommonSchema) +]); +// PUBLIC API +export const env = ensureEnvSchema(process.env, serverEnvSchema); +function getRequiredEnvVarErrorMessage(featureName, envVarName) { + return `${envVarName} is required when using ${featureName}`; +} +//# sourceMappingURL=env.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/env.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/env.js.map new file mode 100644 index 0000000000..3dfa10e116 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/env.js.map @@ -0,0 +1 @@ +{"version":3,"file":"env.js","sourceRoot":"","sources":["../../server/env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACrC,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC;QACrB,cAAc,EAAE,0BAA0B;KAC3C,CAAC;IACF,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,8BAA8B,EAAE,CAAC;SAC9B,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACvB,OAAO,EAAE,iEAAiE;KAC3E,CAAC;SACD,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,MAAM,CAAC;SACtC,OAAO,CAAC,OAAO,CAAC;CACpB,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,CAAC;KACtB,MAAM,CAAC;IACN,cAAc,EAAE,6BAA6B;CAC9C,CAAC;KACD,GAAG,CAAC;IACH,OAAO,EAAE,qCAAqC;CAC/C,CAAC,CAAA;AAEJ,MAAM,eAAe,GAAG,CAAC;KACtB,MAAM,CAAC;IACN,cAAc,EAAE,iCAAiC;CAClD,CAAC;KACD,GAAG,CAAC;IACH,OAAO,EAAE,yCAAyC;CACnD,CAAC,CAAA;AAGJ,2EAA2E;AAC3E,0CAA0C;AAC1C,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAClC,eAAe,EAAE,eAAe;SAC7B,OAAO,CAAC,uBAAuB,CAAC;IACnC,mBAAmB,EAAE,eAAe;SACjC,OAAO,CAAC,wBAAwB,CAAC;CACrC,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IACjC,eAAe,EAAE,eAAe;IAChC,mBAAmB,EAAE,eAAe;CACrC,CAAC,CAAA;AAEF,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;AAC5E,MAAM,eAAe,GAAG,CAAC,CAAC,kBAAkB,CAAC,UAAU,EAAE;IACvD,eAAe,CAAC,KAAK,CAAC,kBAAkB,CAAC;IACzC,gBAAgB,CAAC,KAAK,CAAC,kBAAkB,CAAC;CAC3C,CAAC,CAAA;AAEF,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,eAAe,CAAC,CAAA;AAEhE,SAAS,6BAA6B,CAAC,WAAmB,EAAE,UAAkB;IAC5E,OAAO,GAAG,UAAU,2BAA2B,WAAW,EAAE,CAAA;AAC9D,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.d.ts index dee9613a53..a108f6123f 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.d.ts @@ -4,4 +4,5 @@ export { default as prisma } from './dbClient.js'; export { type ServerSetupFn } from './types/index.js'; export { HttpError } from './HttpError.js'; export { MiddlewareConfigFn } from './middleware/index.js'; +export { env } from './env.js'; export type DbSeedFn = (prisma: PrismaClient) => Promise; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.js index 0e53e0deab..8e75e6f78c 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.js @@ -4,4 +4,6 @@ export { default as config } from './config.js'; export { default as prisma } from './dbClient.js'; // PUBLIC API export { HttpError } from './HttpError.js'; +// PUBLIC API +export { env } from './env.js'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.js.map index b84ac1b303..87ed22f3af 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAA;AAC/C,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,eAAe,CAAA;AAGjD,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAA;AAC/C,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,eAAe,CAAA;AAGjD,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAG1C,aAAa;AACb,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.d.ts index aa893e7838..7ceb994694 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.d.ts @@ -1 +1,2 @@ -export declare function stripTrailingSlash(url?: string): string | undefined; +export declare function stripTrailingSlash(url: string): string; +export declare function stripTrailingSlash(url: undefined): undefined; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.js.map index a7bad96020..e236f1b977 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/url.js.map @@ -1 +1 @@ -{"version":3,"file":"url.js","sourceRoot":"","sources":["../../universal/url.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC3C,OAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC"} \ No newline at end of file +{"version":3,"file":"url.js","sourceRoot":"","sources":["../../universal/url.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC3C,OAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/env/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/env/index.ts new file mode 100644 index 0000000000..4c783125c1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/env/index.ts @@ -0,0 +1,11 @@ +import * as z from 'zod' + +// PUBLIC API +export function defineEnvValidationSchema>( + schema: Schema, +): Schema { + return schema +} + +// PRIVATE API (SDK, Vite config) +export { ensureEnvSchema } from './validation.js' diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/env/validation.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/env/validation.ts new file mode 100644 index 0000000000..a5bc334754 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/env/validation.ts @@ -0,0 +1,25 @@ +import * as z from 'zod' + +const redColor = '\x1b[31m' + +export function ensureEnvSchema( + data: unknown, + schema: Schema +): z.infer { + try { + return schema.parse(data) + } catch (e) { + if (e instanceof z.ZodError) { + const errorOutput = ['', '══ Env vars validation failed ══', ''] + for (const error of e.errors) { + errorOutput.push(` - ${error.message}`) + } + errorOutput.push('') + errorOutput.push('════════════════════════════════') + console.error(redColor, errorOutput.join('\n')) + throw new Error('Error parsing environment variables') + } else { + throw e + } + } +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/package.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/package.json index 2589c5362f..55c07a5084 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/package.json +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/package.json @@ -8,7 +8,6 @@ "axios": "^1.4.0", "express": "~4.21.0", "jsdom": "^21.1.1", - "lodash.merge": "^4.6.2", "mitt": "3.0.0", "msw": "^1.1.0", "prisma": "5.19.1", @@ -16,7 +15,8 @@ "react-hook-form": "^7.45.4", "react-router-dom": "^6.26.2", "superjson": "^2.2.1", - "vitest": "^1.2.1" + "vitest": "^1.2.1", + "zod": "^3.23.8" }, "devDependencies": { "@tsconfig/node18": "latest", @@ -51,6 +51,7 @@ "./core/storage": "./dist/core/storage.js", "./dev": "./dist/dev/index.js", "./entities": "./dist/entities/index.js", + "./env": "./dist/env/index.js", "./ext-src/*": "./dist/ext-src/*.js", "./operations": "./dist/operations/index.js", "./operations/*": "./dist/operations/*", diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/HttpError.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/HttpError.ts index d05a2c841b..bce964712d 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/HttpError.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/HttpError.ts @@ -2,7 +2,12 @@ export class HttpError extends Error { public statusCode: number public data: unknown - constructor (statusCode: number, message?: string, data?: Record, options?: ErrorOptions) { + constructor( + statusCode: number, + message?: string, + data?: Record, + options?: ErrorOptions + ) { super(message, options) if (Error.captureStackTrace) { @@ -11,7 +16,9 @@ export class HttpError extends Error { this.name = this.constructor.name - if (!(Number.isInteger(statusCode) && statusCode >= 400 && statusCode < 600)) { + if ( + !(Number.isInteger(statusCode) && statusCode >= 400 && statusCode < 600) + ) { throw new Error('statusCode has to be integer in range [400, 600).') } this.statusCode = statusCode diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/config.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/config.ts index 1dc9bafb93..3a000a897f 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/config.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/config.ts @@ -1,73 +1,36 @@ -import merge from 'lodash.merge' +import { env } from './env.js' +import { stripTrailingSlash } from '../universal/url.js' -import { stripTrailingSlash } from "../universal/url.js"; +type NodeEnv = typeof env.NODE_ENV -const nodeEnv = process.env.NODE_ENV ?? 'development' - -// TODO: -// - Use dotenv library to consume env vars from a file. -// - Use convict library to define schema and validate env vars. -// https://codingsans.com/blog/node-config-best-practices - -type BaseConfig = { - allowedCORSOrigins: string | string[]; -} - -type CommonConfig = BaseConfig & { - env: string; +type Config = { + env: NodeEnv; isDevelopment: boolean; port: number; - databaseUrl: string | undefined; -} - -type EnvConfig = BaseConfig & { + databaseUrl: string; frontendUrl: string; serverUrl: string; + allowedCORSOrigins: string | string[]; } -type Config = CommonConfig & EnvConfig +const frontendUrl = stripTrailingSlash(env.WASP_WEB_CLIENT_URL) +const serverUrl = stripTrailingSlash(env.WASP_SERVER_URL) -const config: { - all: CommonConfig, - development: EnvConfig, - production: EnvConfig, -} = { - all: { - env: nodeEnv, - isDevelopment: nodeEnv === 'development', - port: process.env.PORT ? parseInt(process.env.PORT) : 3001, - databaseUrl: process.env.DATABASE_URL, - allowedCORSOrigins: [], - }, - development: getDevelopmentConfig(), - production: getProductionConfig(), +const allowedCORSOriginsPerEnv: Record = { + development: '*', + production: [frontendUrl] } - -const resolvedConfig: Config = merge(config.all, config[nodeEnv]) -// PUBLIC API -export default resolvedConfig - -function getDevelopmentConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL ?? 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL ?? 'http://localhost:3001'); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - allowedCORSOrigins: '*', - } +const allowedCORSOrigins = allowedCORSOriginsPerEnv[env.NODE_ENV] + +const config: Config = { + frontendUrl, + serverUrl, + allowedCORSOrigins, + env: env.NODE_ENV, + isDevelopment: env.NODE_ENV === 'development', + port: env.PORT, + databaseUrl: env.DATABASE_URL, } -function getProductionConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - // @ts-ignore - allowedCORSOrigins: [frontendUrl], - } -} +// PUBLIC API +export default config diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/env.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/env.ts new file mode 100644 index 0000000000..c1bd8f5c0f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/env.ts @@ -0,0 +1,65 @@ +import * as z from 'zod' + +import { ensureEnvSchema } from '../env/validation.js' + +const userServerEnvSchema = z.object({}) + +const waspServerCommonSchema = z.object({ + PORT: z.coerce.number().default(3001), + DATABASE_URL: z.string({ + required_error: 'DATABASE_URL is required', + }), + PG_BOSS_NEW_OPTIONS: z.string().optional(), + SKIP_EMAIL_VERIFICATION_IN_DEV: z + .enum(['true', 'false'], { + message: 'SKIP_EMAIL_VERIFICATION_IN_DEV must be either "true" or "false"', + }) + .transform((value) => value === 'true') + .default('false'), +}) + +const serverUrlSchema = z + .string({ + required_error: 'WASP_SERVER_URL is required', + }) + .url({ + message: 'WASP_SERVER_URL must be a valid URL', + }) + +const clientUrlSchema = z + .string({ + required_error: 'WASP_WEB_CLIENT_URL is required', + }) + .url({ + message: 'WASP_WEB_CLIENT_URL must be a valid URL', + }) + + +// In development, we provide default values for some environment variables +// to make the development process easier. +const serverDevSchema = z.object({ + NODE_ENV: z.literal('development'), + WASP_SERVER_URL: serverUrlSchema + .default('http://localhost:3001'), + WASP_WEB_CLIENT_URL: clientUrlSchema + .default('http://localhost:3000/'), +}) + +const serverProdSchema = z.object({ + NODE_ENV: z.literal('production'), + WASP_SERVER_URL: serverUrlSchema, + WASP_WEB_CLIENT_URL: clientUrlSchema, +}) + +const serverCommonSchema = userServerEnvSchema.merge(waspServerCommonSchema) +const serverEnvSchema = z.discriminatedUnion('NODE_ENV', [ + serverDevSchema.merge(serverCommonSchema), + serverProdSchema.merge(serverCommonSchema) +]) + +// PUBLIC API +export const env = ensureEnvSchema(process.env, serverEnvSchema) + +function getRequiredEnvVarErrorMessage(featureName: string, envVarName: string) { + return `${envVarName} is required when using ${featureName}` +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/index.ts index 535077900b..0f95deb90a 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/index.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/index.ts @@ -10,6 +10,8 @@ export { type ServerSetupFn } from './types/index.js' export { HttpError } from './HttpError.js' // PUBLIC API export { MiddlewareConfigFn } from './middleware/index.js' +// PUBLIC API +export { env } from './env.js' // PUBLIC API export type DbSeedFn = (prisma: PrismaClient) => Promise diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/url.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/url.ts index d21c06c65c..126678dac9 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/url.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/url.ts @@ -1,3 +1,5 @@ +export function stripTrailingSlash(url: string): string +export function stripTrailingSlash(url: undefined): undefined export function stripTrailingSlash(url?: string): string | undefined { return url?.replace(/\/$/, ""); } 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 7a57413e11..51ec87354a 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 @@ -34,9 +34,8 @@ "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", - "start": "npm run validate-env && node --enable-source-maps -r dotenv/config bundle/server.js", + "start": "node --enable-source-maps -r dotenv/config bundle/server.js", "start-production": "NODE_ENV=production npm run start", - "validate-env": "node -r dotenv/config ./scripts/validate-env.mjs", "watch": "nodemon --exec 'npm run bundle-and-start || exit 1'" }, "type": "module", diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/scripts/validate-env.mjs deleted file mode 100644 index f6e50aceca..0000000000 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/scripts/validate-env.mjs +++ /dev/null @@ -1,5 +0,0 @@ -import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; - -console.info("🔍 Validating environment variables..."); -throwIfNotValidAbsoluteURL(process.env.WASP_WEB_CLIENT_URL, 'Environment variable WASP_WEB_CLIENT_URL'); -throwIfNotValidAbsoluteURL(process.env.WASP_SERVER_URL, 'Environment variable WASP_SERVER_URL'); diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/polyfill.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/polyfill.ts index 7931d12eb0..9279daf6da 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/polyfill.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/server/src/polyfill.ts @@ -1,11 +1,10 @@ // This is a polyfill for Node.js 18 webcrypto API so Lucia can use it // for random number generation. -import { webcrypto } from "node:crypto"; +import { webcrypto } from 'node:crypto' // NOTE: node < 19 doesn't have Crypto API, which we need for Lucia, so we apply the polyfill if Crypto API is not defined. -if (typeof globalThis.crypto === "undefined") { +if (typeof globalThis.crypto === 'undefined') { // @ts-ignore - globalThis.crypto = webcrypto as Crypto; + globalThis.crypto = webcrypto as Crypto } - diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/package.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/package.json index 08f5ace058..a6a34d1231 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/package.json +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/package.json @@ -18,8 +18,7 @@ "devDependencies": { "@tsconfig/vite-react": "^2.0.0", "@types/react-dom": "^18.0.11", - "@vitejs/plugin-react": "^4.2.1", - "dotenv": "^16.0.3" + "@vitejs/plugin-react": "^4.2.1" }, "engineStrict": true, "engines": { @@ -28,9 +27,8 @@ "name": "waspBuild", "private": true, "scripts": { - "build": "npm run validate-env && tsc && vite build", - "start": "npm run validate-env && vite", - "validate-env": "node -r dotenv/config ./scripts/validate-env.mjs" + "build": "tsc && vite build", + "start": "vite" }, "type": "module", "version": "0.0.0" diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/scripts/validate-env.mjs deleted file mode 100644 index 18ee507c9e..0000000000 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/scripts/validate-env.mjs +++ /dev/null @@ -1,4 +0,0 @@ -import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; - -console.info("🔍 Validating environment variables..."); -throwIfNotValidAbsoluteURL(process.env.REACT_APP_API_URL, 'Environemnt variable REACT_APP_API_URL'); diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/components/DefaultRootErrorBoundary.tsx b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/components/DefaultRootErrorBoundary.tsx index 7af24e15d6..1e931935e6 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/components/DefaultRootErrorBoundary.tsx +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/web-app/src/components/DefaultRootErrorBoundary.tsx @@ -7,7 +7,10 @@ export function DefaultRootErrorBoundary() { console.error(error) return ( -
There was an error rendering this page. Check the browser console for more information.
+
+ There was an error rendering this page. Check the browser console for + more information. +
) } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/config.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/config.ts index 82b0f80b6a..fff77cb01c 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/config.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/config.ts @@ -1,6 +1,7 @@ import { stripTrailingSlash } from '../universal/url.js' +import { env } from './env.js' -const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; +const apiUrl = stripTrailingSlash(env.REACT_APP_API_URL) // PUBLIC API export type ClientConfig = { diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/env.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/env.ts new file mode 100644 index 0000000000..8ddab287f7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/env.ts @@ -0,0 +1,18 @@ +import * as z from 'zod' + +import { ensureEnvSchema } from '../env/validation.js' + +const userClientEnvSchema = z.object({}) + +const waspClientEnvSchema = z.object({ + REACT_APP_API_URL: z + .string({ + required_error: 'REACT_APP_API_URL is required', + }) + .default('http://localhost:3001') +}) + +const clientEnvSchema = userClientEnvSchema.merge(waspClientEnvSchema) + +// PUBLIC API +export const env = ensureEnvSchema(import.meta.env, clientEnvSchema) diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/index.ts index cfce564c4d..859f8656b6 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/index.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/index.ts @@ -11,4 +11,7 @@ export enum HttpMethod { export type Route = { method: HttpMethod; path: string } // PUBLIC API -export { config, ClientConfig } from './config' +export { config, ClientConfig } from './config.js' + +// PUBLIC API +export { env } from './env.js' diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/config.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/config.js index 1dffbd68bc..7e6149f386 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/config.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/config.js @@ -1,5 +1,6 @@ import { stripTrailingSlash } from '../universal/url.js'; -const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; +import { env } from './env.js'; +const apiUrl = stripTrailingSlash(env.REACT_APP_API_URL); // PUBLIC API export const config = { apiUrl, diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/config.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/config.js.map index d26d37022b..f9e186b838 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/config.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAExD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;AAOxD,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/env.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/env.d.ts new file mode 100644 index 0000000000..5a9417a810 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/env.d.ts @@ -0,0 +1,3 @@ +export declare const env: { + REACT_APP_API_URL: string; +}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/env.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/env.js new file mode 100644 index 0000000000..91164c3768 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/env.js @@ -0,0 +1,14 @@ +import * as z from 'zod'; +import { ensureEnvSchema } from '../env/validation.js'; +const userClientEnvSchema = z.object({}); +const waspClientEnvSchema = z.object({ + REACT_APP_API_URL: z + .string({ + required_error: 'REACT_APP_API_URL is required', + }) + .default('http://localhost:3001') +}); +const clientEnvSchema = userClientEnvSchema.merge(waspClientEnvSchema); +// PUBLIC API +export const env = ensureEnvSchema(import.meta.env, clientEnvSchema); +//# sourceMappingURL=env.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/env.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/env.js.map new file mode 100644 index 0000000000..d230f15c0d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/env.js.map @@ -0,0 +1 @@ +{"version":3,"file":"env.js","sourceRoot":"","sources":["../../client/env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,iBAAiB,EAAE,CAAC;SACjB,MAAM,CAAC;QACN,cAAc,EAAE,+BAA+B;KAChD,CAAC;SACD,OAAO,CAAC,uBAAuB,CAAC;CACpC,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,mBAAmB,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;AAEtE,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.d.ts index 7f5f4bfbc8..6498c439bd 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.d.ts @@ -8,4 +8,5 @@ export type Route = { method: HttpMethod; path: string; }; -export { config, ClientConfig } from './config'; +export { config, ClientConfig } from './config.js'; +export { env } from './env.js'; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.js index 5a7f13dcae..2f4daa7ae3 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.js @@ -8,5 +8,7 @@ export var HttpMethod; HttpMethod["Delete"] = "DELETE"; })(HttpMethod || (HttpMethod = {})); // PUBLIC API -export { config } from './config'; +export { config } from './config.js'; +// PUBLIC API +export { env } from './env.js'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.js.map index 879953c8df..f3611558dc 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,MAAM,EAAgB,MAAM,UAAU,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,MAAM,EAAgB,MAAM,aAAa,CAAA;AAElD,aAAa;AACb,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/index.d.ts new file mode 100644 index 0000000000..d1dafc25fd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/index.d.ts @@ -0,0 +1,3 @@ +import * as z from 'zod'; +export declare function defineEnvValidationSchema>(schema: Schema): Schema; +export { ensureEnvSchema } from './validation.js'; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/index.js new file mode 100644 index 0000000000..17e695d087 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/index.js @@ -0,0 +1,7 @@ +// PUBLIC API +export function defineEnvValidationSchema(schema) { + return schema; +} +// PRIVATE API (SDK, Vite config) +export { ensureEnvSchema } from './validation.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/index.js.map new file mode 100644 index 0000000000..75b4ff7de3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../env/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,MAAM,UAAU,yBAAyB,CACvC,MAAc;IAEd,OAAO,MAAM,CAAA;AACf,CAAC;AAED,iCAAiC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/validation.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/validation.d.ts new file mode 100644 index 0000000000..6bc9d059a3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/validation.d.ts @@ -0,0 +1,2 @@ +import * as z from 'zod'; +export declare function ensureEnvSchema(data: unknown, schema: Schema): z.infer; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/validation.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/validation.js new file mode 100644 index 0000000000..8463eb578e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/validation.js @@ -0,0 +1,23 @@ +import * as z from 'zod'; +const redColor = '\x1b[31m'; +export function ensureEnvSchema(data, schema) { + try { + return schema.parse(data); + } + catch (e) { + if (e instanceof z.ZodError) { + const errorOutput = ['', '══ Env vars validation failed ══', '']; + for (const error of e.errors) { + errorOutput.push(` - ${error.message}`); + } + errorOutput.push(''); + errorOutput.push('════════════════════════════════'); + console.error(redColor, errorOutput.join('\n')); + throw new Error('Error parsing environment variables'); + } + else { + throw e; + } + } +} +//# sourceMappingURL=validation.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/validation.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/validation.js.map new file mode 100644 index 0000000000..1d57b14a0b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/env/validation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../env/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,MAAM,QAAQ,GAAG,UAAU,CAAA;AAE3B,MAAM,UAAU,eAAe,CAC7B,IAAa,EACb,MAAc;IAEd,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;YAC5B,MAAM,WAAW,GAAG,CAAC,EAAE,EAAE,kCAAkC,EAAE,EAAE,CAAC,CAAA;YAChE,KAAK,MAAM,KAAK,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;gBAC7B,WAAW,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;YACzC,CAAC;YACD,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACpB,WAAW,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAA;YACpD,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;YAC/C,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;QACxD,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,CAAA;QACT,CAAC;IACH,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js.map index 8163354e1b..462e1c1811 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js.map @@ -1 +1 @@ -{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,OAAsB;QACvG,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YACE,UAAkB,EAClB,OAAgB,EAChB,IAA8B,EAC9B,OAAsB;QAEtB,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IACE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EACxE,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.d.ts index 68bb448c56..70f438bdf0 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.d.ts @@ -1,16 +1,13 @@ -type BaseConfig = { - allowedCORSOrigins: string | string[]; -}; -type CommonConfig = BaseConfig & { - env: string; +import { env } from './env.js'; +type NodeEnv = typeof env.NODE_ENV; +type Config = { + env: NodeEnv; isDevelopment: boolean; port: number; - databaseUrl: string | undefined; -}; -type EnvConfig = BaseConfig & { + databaseUrl: string; frontendUrl: string; serverUrl: string; + allowedCORSOrigins: string | string[]; }; -type Config = CommonConfig & EnvConfig; -declare const resolvedConfig: Config; -export default resolvedConfig; +declare const config: Config; +export default config; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js index e4f89082c8..dcc80722ab 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js @@ -1,43 +1,21 @@ -var _a; -import merge from 'lodash.merge'; -import { stripTrailingSlash } from "../universal/url.js"; -const nodeEnv = (_a = process.env.NODE_ENV) !== null && _a !== void 0 ? _a : 'development'; +import { env } from './env.js'; +import { stripTrailingSlash } from '../universal/url.js'; +const frontendUrl = stripTrailingSlash(env.WASP_WEB_CLIENT_URL); +const serverUrl = stripTrailingSlash(env.WASP_SERVER_URL); +const allowedCORSOriginsPerEnv = { + development: '*', + production: [frontendUrl] +}; +const allowedCORSOrigins = allowedCORSOriginsPerEnv[env.NODE_ENV]; const config = { - all: { - env: nodeEnv, - isDevelopment: nodeEnv === 'development', - port: process.env.PORT ? parseInt(process.env.PORT) : 3001, - databaseUrl: process.env.DATABASE_URL, - allowedCORSOrigins: [], - }, - development: getDevelopmentConfig(), - production: getProductionConfig(), + frontendUrl, + serverUrl, + allowedCORSOrigins, + env: env.NODE_ENV, + isDevelopment: env.NODE_ENV === 'development', + port: env.PORT, + databaseUrl: env.DATABASE_URL, }; -const resolvedConfig = merge(config.all, config[nodeEnv]); // PUBLIC API -export default resolvedConfig; -function getDevelopmentConfig() { - var _a, _b; - const frontendUrl = stripTrailingSlash((_a = process.env.WASP_WEB_CLIENT_URL) !== null && _a !== void 0 ? _a : 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash((_b = process.env.WASP_SERVER_URL) !== null && _b !== void 0 ? _b : 'http://localhost:3001'); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - allowedCORSOrigins: '*', - }; -} -function getProductionConfig() { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - // @ts-ignore - allowedCORSOrigins: [frontendUrl], - }; -} +export default config; //# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js.map index e284580bbd..9fd077fa81 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,mCAAI,aAAa,CAAA;AAyBrD,MAAM,MAAM,GAIR;IACF,GAAG,EAAE;QACH,GAAG,EAAE,OAAO;QACZ,aAAa,EAAE,OAAO,KAAK,aAAa;QACxC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;QAC1D,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;KACvB;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;CAClC,CAAA;AAED,MAAM,cAAc,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACjE,aAAa;AACb,eAAe,cAAc,CAAA;AAE7B,SAAS,oBAAoB;;IAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,mBAAmB,mCAAI,wBAAwB,CAAC,CAAC;IACpG,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,eAAe,mCAAI,uBAAuB,CAAC,CAAC;IAC7F,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,kBAAkB,EAAE,GAAG;KACxB,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAClE,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,aAAa;QACb,kBAAkB,EAAE,CAAC,WAAW,CAAC;KAClC,CAAA;AACH,CAAC"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAcxD,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;AAC/D,MAAM,SAAS,GAAG,kBAAkB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;AAEzD,MAAM,wBAAwB,GAAuC;IACnE,WAAW,EAAE,GAAG;IAChB,UAAU,EAAE,CAAC,WAAW,CAAC;CAC1B,CAAA;AACD,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAEjE,MAAM,MAAM,GAAW;IACrB,WAAW;IACX,SAAS;IACT,kBAAkB;IAClB,GAAG,EAAE,GAAG,CAAC,QAAQ;IACjB,aAAa,EAAE,GAAG,CAAC,QAAQ,KAAK,aAAa;IAC7C,IAAI,EAAE,GAAG,CAAC,IAAI;IACd,WAAW,EAAE,GAAG,CAAC,YAAY;CAC9B,CAAA;AAED,aAAa;AACb,eAAe,MAAM,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/env.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/env.d.ts new file mode 100644 index 0000000000..667ea30e35 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/env.d.ts @@ -0,0 +1,17 @@ +export declare const env: { + PORT: number; + DATABASE_URL: string; + SKIP_EMAIL_VERIFICATION_IN_DEV: boolean; + NODE_ENV: "development"; + WASP_SERVER_URL: string; + WASP_WEB_CLIENT_URL: string; + PG_BOSS_NEW_OPTIONS?: string | undefined; +} | { + PORT: number; + DATABASE_URL: string; + SKIP_EMAIL_VERIFICATION_IN_DEV: boolean; + NODE_ENV: "production"; + WASP_SERVER_URL: string; + WASP_WEB_CLIENT_URL: string; + PG_BOSS_NEW_OPTIONS?: string | undefined; +}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/env.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/env.js new file mode 100644 index 0000000000..1bfc3e0b6e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/env.js @@ -0,0 +1,55 @@ +import * as z from 'zod'; +import { ensureEnvSchema } from '../env/validation.js'; +const userServerEnvSchema = z.object({}); +const waspServerCommonSchema = z.object({ + PORT: z.coerce.number().default(3001), + DATABASE_URL: z.string({ + required_error: 'DATABASE_URL is required', + }), + PG_BOSS_NEW_OPTIONS: z.string().optional(), + SKIP_EMAIL_VERIFICATION_IN_DEV: z + .enum(['true', 'false'], { + message: 'SKIP_EMAIL_VERIFICATION_IN_DEV must be either "true" or "false"', + }) + .transform((value) => value === 'true') + .default('false'), +}); +const serverUrlSchema = z + .string({ + required_error: 'WASP_SERVER_URL is required', +}) + .url({ + message: 'WASP_SERVER_URL must be a valid URL', +}); +const clientUrlSchema = z + .string({ + required_error: 'WASP_WEB_CLIENT_URL is required', +}) + .url({ + message: 'WASP_WEB_CLIENT_URL must be a valid URL', +}); +// In development, we provide default values for some environment variables +// to make the development process easier. +const serverDevSchema = z.object({ + NODE_ENV: z.literal('development'), + WASP_SERVER_URL: serverUrlSchema + .default('http://localhost:3001'), + WASP_WEB_CLIENT_URL: clientUrlSchema + .default('http://localhost:3000/'), +}); +const serverProdSchema = z.object({ + NODE_ENV: z.literal('production'), + WASP_SERVER_URL: serverUrlSchema, + WASP_WEB_CLIENT_URL: clientUrlSchema, +}); +const serverCommonSchema = userServerEnvSchema.merge(waspServerCommonSchema); +const serverEnvSchema = z.discriminatedUnion('NODE_ENV', [ + serverDevSchema.merge(serverCommonSchema), + serverProdSchema.merge(serverCommonSchema) +]); +// PUBLIC API +export const env = ensureEnvSchema(process.env, serverEnvSchema); +function getRequiredEnvVarErrorMessage(featureName, envVarName) { + return `${envVarName} is required when using ${featureName}`; +} +//# sourceMappingURL=env.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/env.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/env.js.map new file mode 100644 index 0000000000..3dfa10e116 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/env.js.map @@ -0,0 +1 @@ +{"version":3,"file":"env.js","sourceRoot":"","sources":["../../server/env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACrC,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC;QACrB,cAAc,EAAE,0BAA0B;KAC3C,CAAC;IACF,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,8BAA8B,EAAE,CAAC;SAC9B,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACvB,OAAO,EAAE,iEAAiE;KAC3E,CAAC;SACD,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,MAAM,CAAC;SACtC,OAAO,CAAC,OAAO,CAAC;CACpB,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,CAAC;KACtB,MAAM,CAAC;IACN,cAAc,EAAE,6BAA6B;CAC9C,CAAC;KACD,GAAG,CAAC;IACH,OAAO,EAAE,qCAAqC;CAC/C,CAAC,CAAA;AAEJ,MAAM,eAAe,GAAG,CAAC;KACtB,MAAM,CAAC;IACN,cAAc,EAAE,iCAAiC;CAClD,CAAC;KACD,GAAG,CAAC;IACH,OAAO,EAAE,yCAAyC;CACnD,CAAC,CAAA;AAGJ,2EAA2E;AAC3E,0CAA0C;AAC1C,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAClC,eAAe,EAAE,eAAe;SAC7B,OAAO,CAAC,uBAAuB,CAAC;IACnC,mBAAmB,EAAE,eAAe;SACjC,OAAO,CAAC,wBAAwB,CAAC;CACrC,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IACjC,eAAe,EAAE,eAAe;IAChC,mBAAmB,EAAE,eAAe;CACrC,CAAC,CAAA;AAEF,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;AAC5E,MAAM,eAAe,GAAG,CAAC,CAAC,kBAAkB,CAAC,UAAU,EAAE;IACvD,eAAe,CAAC,KAAK,CAAC,kBAAkB,CAAC;IACzC,gBAAgB,CAAC,KAAK,CAAC,kBAAkB,CAAC;CAC3C,CAAC,CAAA;AAEF,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,eAAe,CAAC,CAAA;AAEhE,SAAS,6BAA6B,CAAC,WAAmB,EAAE,UAAkB;IAC5E,OAAO,GAAG,UAAU,2BAA2B,WAAW,EAAE,CAAA;AAC9D,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.d.ts index dee9613a53..a108f6123f 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.d.ts @@ -4,4 +4,5 @@ export { default as prisma } from './dbClient.js'; export { type ServerSetupFn } from './types/index.js'; export { HttpError } from './HttpError.js'; export { MiddlewareConfigFn } from './middleware/index.js'; +export { env } from './env.js'; export type DbSeedFn = (prisma: PrismaClient) => Promise; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.js index 0e53e0deab..8e75e6f78c 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.js @@ -4,4 +4,6 @@ export { default as config } from './config.js'; export { default as prisma } from './dbClient.js'; // PUBLIC API export { HttpError } from './HttpError.js'; +// PUBLIC API +export { env } from './env.js'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.js.map index b84ac1b303..87ed22f3af 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAA;AAC/C,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,eAAe,CAAA;AAGjD,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAA;AAC/C,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,eAAe,CAAA;AAGjD,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAG1C,aAAa;AACb,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/url.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/url.d.ts index aa893e7838..7ceb994694 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/url.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/url.d.ts @@ -1 +1,2 @@ -export declare function stripTrailingSlash(url?: string): string | undefined; +export declare function stripTrailingSlash(url: string): string; +export declare function stripTrailingSlash(url: undefined): undefined; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/url.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/url.js.map index a7bad96020..e236f1b977 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/url.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/url.js.map @@ -1 +1 @@ -{"version":3,"file":"url.js","sourceRoot":"","sources":["../../universal/url.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC3C,OAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC"} \ No newline at end of file +{"version":3,"file":"url.js","sourceRoot":"","sources":["../../universal/url.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC3C,OAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/env/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/env/index.ts new file mode 100644 index 0000000000..4c783125c1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/env/index.ts @@ -0,0 +1,11 @@ +import * as z from 'zod' + +// PUBLIC API +export function defineEnvValidationSchema>( + schema: Schema, +): Schema { + return schema +} + +// PRIVATE API (SDK, Vite config) +export { ensureEnvSchema } from './validation.js' diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/env/validation.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/env/validation.ts new file mode 100644 index 0000000000..a5bc334754 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/env/validation.ts @@ -0,0 +1,25 @@ +import * as z from 'zod' + +const redColor = '\x1b[31m' + +export function ensureEnvSchema( + data: unknown, + schema: Schema +): z.infer { + try { + return schema.parse(data) + } catch (e) { + if (e instanceof z.ZodError) { + const errorOutput = ['', '══ Env vars validation failed ══', ''] + for (const error of e.errors) { + errorOutput.push(` - ${error.message}`) + } + errorOutput.push('') + errorOutput.push('════════════════════════════════') + console.error(redColor, errorOutput.join('\n')) + throw new Error('Error parsing environment variables') + } else { + throw e + } + } +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/package.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/package.json index 2589c5362f..55c07a5084 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/package.json +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/package.json @@ -8,7 +8,6 @@ "axios": "^1.4.0", "express": "~4.21.0", "jsdom": "^21.1.1", - "lodash.merge": "^4.6.2", "mitt": "3.0.0", "msw": "^1.1.0", "prisma": "5.19.1", @@ -16,7 +15,8 @@ "react-hook-form": "^7.45.4", "react-router-dom": "^6.26.2", "superjson": "^2.2.1", - "vitest": "^1.2.1" + "vitest": "^1.2.1", + "zod": "^3.23.8" }, "devDependencies": { "@tsconfig/node18": "latest", @@ -51,6 +51,7 @@ "./core/storage": "./dist/core/storage.js", "./dev": "./dist/dev/index.js", "./entities": "./dist/entities/index.js", + "./env": "./dist/env/index.js", "./ext-src/*": "./dist/ext-src/*.js", "./operations": "./dist/operations/index.js", "./operations/*": "./dist/operations/*", diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/HttpError.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/HttpError.ts index d05a2c841b..bce964712d 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/HttpError.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/HttpError.ts @@ -2,7 +2,12 @@ export class HttpError extends Error { public statusCode: number public data: unknown - constructor (statusCode: number, message?: string, data?: Record, options?: ErrorOptions) { + constructor( + statusCode: number, + message?: string, + data?: Record, + options?: ErrorOptions + ) { super(message, options) if (Error.captureStackTrace) { @@ -11,7 +16,9 @@ export class HttpError extends Error { this.name = this.constructor.name - if (!(Number.isInteger(statusCode) && statusCode >= 400 && statusCode < 600)) { + if ( + !(Number.isInteger(statusCode) && statusCode >= 400 && statusCode < 600) + ) { throw new Error('statusCode has to be integer in range [400, 600).') } this.statusCode = statusCode diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/config.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/config.ts index 1dc9bafb93..3a000a897f 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/config.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/config.ts @@ -1,73 +1,36 @@ -import merge from 'lodash.merge' +import { env } from './env.js' +import { stripTrailingSlash } from '../universal/url.js' -import { stripTrailingSlash } from "../universal/url.js"; +type NodeEnv = typeof env.NODE_ENV -const nodeEnv = process.env.NODE_ENV ?? 'development' - -// TODO: -// - Use dotenv library to consume env vars from a file. -// - Use convict library to define schema and validate env vars. -// https://codingsans.com/blog/node-config-best-practices - -type BaseConfig = { - allowedCORSOrigins: string | string[]; -} - -type CommonConfig = BaseConfig & { - env: string; +type Config = { + env: NodeEnv; isDevelopment: boolean; port: number; - databaseUrl: string | undefined; -} - -type EnvConfig = BaseConfig & { + databaseUrl: string; frontendUrl: string; serverUrl: string; + allowedCORSOrigins: string | string[]; } -type Config = CommonConfig & EnvConfig +const frontendUrl = stripTrailingSlash(env.WASP_WEB_CLIENT_URL) +const serverUrl = stripTrailingSlash(env.WASP_SERVER_URL) -const config: { - all: CommonConfig, - development: EnvConfig, - production: EnvConfig, -} = { - all: { - env: nodeEnv, - isDevelopment: nodeEnv === 'development', - port: process.env.PORT ? parseInt(process.env.PORT) : 3001, - databaseUrl: process.env.DATABASE_URL, - allowedCORSOrigins: [], - }, - development: getDevelopmentConfig(), - production: getProductionConfig(), +const allowedCORSOriginsPerEnv: Record = { + development: '*', + production: [frontendUrl] } - -const resolvedConfig: Config = merge(config.all, config[nodeEnv]) -// PUBLIC API -export default resolvedConfig - -function getDevelopmentConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL ?? 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL ?? 'http://localhost:3001'); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - allowedCORSOrigins: '*', - } +const allowedCORSOrigins = allowedCORSOriginsPerEnv[env.NODE_ENV] + +const config: Config = { + frontendUrl, + serverUrl, + allowedCORSOrigins, + env: env.NODE_ENV, + isDevelopment: env.NODE_ENV === 'development', + port: env.PORT, + databaseUrl: env.DATABASE_URL, } -function getProductionConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - // @ts-ignore - allowedCORSOrigins: [frontendUrl], - } -} +// PUBLIC API +export default config diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/env.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/env.ts new file mode 100644 index 0000000000..c1bd8f5c0f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/env.ts @@ -0,0 +1,65 @@ +import * as z from 'zod' + +import { ensureEnvSchema } from '../env/validation.js' + +const userServerEnvSchema = z.object({}) + +const waspServerCommonSchema = z.object({ + PORT: z.coerce.number().default(3001), + DATABASE_URL: z.string({ + required_error: 'DATABASE_URL is required', + }), + PG_BOSS_NEW_OPTIONS: z.string().optional(), + SKIP_EMAIL_VERIFICATION_IN_DEV: z + .enum(['true', 'false'], { + message: 'SKIP_EMAIL_VERIFICATION_IN_DEV must be either "true" or "false"', + }) + .transform((value) => value === 'true') + .default('false'), +}) + +const serverUrlSchema = z + .string({ + required_error: 'WASP_SERVER_URL is required', + }) + .url({ + message: 'WASP_SERVER_URL must be a valid URL', + }) + +const clientUrlSchema = z + .string({ + required_error: 'WASP_WEB_CLIENT_URL is required', + }) + .url({ + message: 'WASP_WEB_CLIENT_URL must be a valid URL', + }) + + +// In development, we provide default values for some environment variables +// to make the development process easier. +const serverDevSchema = z.object({ + NODE_ENV: z.literal('development'), + WASP_SERVER_URL: serverUrlSchema + .default('http://localhost:3001'), + WASP_WEB_CLIENT_URL: clientUrlSchema + .default('http://localhost:3000/'), +}) + +const serverProdSchema = z.object({ + NODE_ENV: z.literal('production'), + WASP_SERVER_URL: serverUrlSchema, + WASP_WEB_CLIENT_URL: clientUrlSchema, +}) + +const serverCommonSchema = userServerEnvSchema.merge(waspServerCommonSchema) +const serverEnvSchema = z.discriminatedUnion('NODE_ENV', [ + serverDevSchema.merge(serverCommonSchema), + serverProdSchema.merge(serverCommonSchema) +]) + +// PUBLIC API +export const env = ensureEnvSchema(process.env, serverEnvSchema) + +function getRequiredEnvVarErrorMessage(featureName: string, envVarName: string) { + return `${envVarName} is required when using ${featureName}` +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/index.ts index 535077900b..0f95deb90a 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/index.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/index.ts @@ -10,6 +10,8 @@ export { type ServerSetupFn } from './types/index.js' export { HttpError } from './HttpError.js' // PUBLIC API export { MiddlewareConfigFn } from './middleware/index.js' +// PUBLIC API +export { env } from './env.js' // PUBLIC API export type DbSeedFn = (prisma: PrismaClient) => Promise diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/url.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/url.ts index d21c06c65c..126678dac9 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/url.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/url.ts @@ -1,3 +1,5 @@ +export function stripTrailingSlash(url: string): string +export function stripTrailingSlash(url: undefined): undefined export function stripTrailingSlash(url?: string): string | undefined { return url?.replace(/\/$/, ""); } diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest b/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest index 0ebc3d1eef..24e8b832d0 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest @@ -6,6 +6,7 @@ waspCompile/.wasp/out/installedNpmDepsLog.json waspCompile/.wasp/out/sdk/wasp/api/events.ts waspCompile/.wasp/out/sdk/wasp/api/index.ts waspCompile/.wasp/out/sdk/wasp/client/config.ts +waspCompile/.wasp/out/sdk/wasp/client/env.ts waspCompile/.wasp/out/sdk/wasp/client/index.ts waspCompile/.wasp/out/sdk/wasp/client/operations/actions/core.ts waspCompile/.wasp/out/sdk/wasp/client/operations/actions/index.ts @@ -35,6 +36,9 @@ waspCompile/.wasp/out/sdk/wasp/dist/api/index.js.map waspCompile/.wasp/out/sdk/wasp/dist/client/config.d.ts waspCompile/.wasp/out/sdk/wasp/dist/client/config.js waspCompile/.wasp/out/sdk/wasp/dist/client/config.js.map +waspCompile/.wasp/out/sdk/wasp/dist/client/env.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/client/env.js +waspCompile/.wasp/out/sdk/wasp/dist/client/env.js.map waspCompile/.wasp/out/sdk/wasp/dist/client/index.d.ts waspCompile/.wasp/out/sdk/wasp/dist/client/index.js waspCompile/.wasp/out/sdk/wasp/dist/client/index.js.map @@ -98,6 +102,12 @@ waspCompile/.wasp/out/sdk/wasp/dist/dev/index.js.map waspCompile/.wasp/out/sdk/wasp/dist/entities/index.d.ts waspCompile/.wasp/out/sdk/wasp/dist/entities/index.js waspCompile/.wasp/out/sdk/wasp/dist/entities/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/env/index.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/env/index.js +waspCompile/.wasp/out/sdk/wasp/dist/env/index.js.map +waspCompile/.wasp/out/sdk/wasp/dist/env/validation.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/env/validation.js +waspCompile/.wasp/out/sdk/wasp/dist/env/validation.js.map waspCompile/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts waspCompile/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx waspCompile/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map @@ -119,6 +129,9 @@ waspCompile/.wasp/out/sdk/wasp/dist/server/config.js.map waspCompile/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts waspCompile/.wasp/out/sdk/wasp/dist/server/dbClient.js waspCompile/.wasp/out/sdk/wasp/dist/server/dbClient.js.map +waspCompile/.wasp/out/sdk/wasp/dist/server/env.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/server/env.js +waspCompile/.wasp/out/sdk/wasp/dist/server/env.js.map waspCompile/.wasp/out/sdk/wasp/dist/server/index.d.ts waspCompile/.wasp/out/sdk/wasp/dist/server/index.js waspCompile/.wasp/out/sdk/wasp/dist/server/index.js.map @@ -165,6 +178,8 @@ waspCompile/.wasp/out/sdk/wasp/dist/universal/validators.d.ts waspCompile/.wasp/out/sdk/wasp/dist/universal/validators.js waspCompile/.wasp/out/sdk/wasp/dist/universal/validators.js.map waspCompile/.wasp/out/sdk/wasp/entities/index.ts +waspCompile/.wasp/out/sdk/wasp/env/index.ts +waspCompile/.wasp/out/sdk/wasp/env/validation.ts waspCompile/.wasp/out/sdk/wasp/ext-src/Main.css waspCompile/.wasp/out/sdk/wasp/ext-src/MainPage.jsx waspCompile/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts @@ -177,6 +192,7 @@ waspCompile/.wasp/out/sdk/wasp/server/_types/serialization.ts waspCompile/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts waspCompile/.wasp/out/sdk/wasp/server/config.ts waspCompile/.wasp/out/sdk/wasp/server/dbClient.ts +waspCompile/.wasp/out/sdk/wasp/server/env.ts waspCompile/.wasp/out/sdk/wasp/server/index.ts waspCompile/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts waspCompile/.wasp/out/sdk/wasp/server/middleware/index.ts @@ -200,7 +216,6 @@ waspCompile/.wasp/out/server/README.md waspCompile/.wasp/out/server/nodemon.json waspCompile/.wasp/out/server/package.json waspCompile/.wasp/out/server/rollup.config.js -waspCompile/.wasp/out/server/scripts/validate-env.mjs waspCompile/.wasp/out/server/src/app.js waspCompile/.wasp/out/server/src/middleware/globalMiddleware.ts waspCompile/.wasp/out/server/src/middleware/index.ts @@ -219,7 +234,6 @@ waspCompile/.wasp/out/web-app/package.json waspCompile/.wasp/out/web-app/public/.gitkeep waspCompile/.wasp/out/web-app/public/favicon.ico waspCompile/.wasp/out/web-app/public/manifest.json -waspCompile/.wasp/out/web-app/scripts/validate-env.mjs waspCompile/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx waspCompile/.wasp/out/web-app/src/components/FullPageWrapper.tsx waspCompile/.wasp/out/web-app/src/components/Loader.module.css 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 59995964f9..36ac1d92aa 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 @@ -18,14 +18,21 @@ "file", "../out/sdk/wasp/client/config.ts" ], - "d94e8bee5fd8f6793b511652b9ee558e57f4913595763137a5385cd929648168" + "4c5835ad64352cc87a4a17e41fd70333bc0d1eedd7339d7ad3d3507cdb64038d" + ], + [ + [ + "file", + "../out/sdk/wasp/client/env.ts" + ], + "2a3602d40b299fbfa1a6275fe67828d5653d9f3265ba8204b75178aa41dcbae0" ], [ [ "file", "../out/sdk/wasp/client/index.ts" ], - "2b3651e7040a63cfd6a271c2aa89f21cf01170e0abeb6c5ab74adde324852fe4" + "b55e5c34c2fdb50e608bcb4331fa2e67724f1fbfb21e1b93680b0f5fe2b7005a" ], [ [ @@ -167,6 +174,20 @@ ], "c59b97b122b977b5171686c92ee5ff2d80d397c2e83cc0915affb6ee136406fb" ], + [ + [ + "file", + "../out/sdk/wasp/env/index.ts" + ], + "d92b4832e9d4249ae5b1f00c0f9760d6841aa44bc199550414793a1d57a6845e" + ], + [ + [ + "file", + "../out/sdk/wasp/env/validation.ts" + ], + "e22b2fb8931275d3b1bd3176cbdbf753d22fc61887ded0e93cd8febf1b97d260" + ], [ [ "file", @@ -200,7 +221,7 @@ "file", "../out/sdk/wasp/package.json" ], - "6f1afd30c951e1f49740256440cd626c9cb521cf0822d93d2d2a5d63d8719d7b" + "b991fb5ade61a662dea3f21bf09aa30379f30ea76204a369c0800b1413256a64" ], [ [ @@ -214,7 +235,7 @@ "file", "../out/sdk/wasp/server/HttpError.ts" ], - "f375fb45eeb16381b8cc575503db302c005ddaa1b35d837ca0ea043fe8ec6ccb" + "9c1b2449d8e9d68470c6014054a3c3074069a104ddb291b9089c30d624a2d9d9" ], [ [ @@ -242,7 +263,7 @@ "file", "../out/sdk/wasp/server/config.ts" ], - "5dd35660e0969defaa3c180179919f4922ab7bc041746872dff7f2280c1872ae" + "8431eaf0332cdbdd2f36b4c232b4b6b65fd19bad58fe51922f5b2662f22fc8ad" ], [ [ @@ -251,12 +272,19 @@ ], "50f11eb232174184be5fd44e8ee3875c30707b486c8c70c3f7bfb93609d38e66" ], + [ + [ + "file", + "../out/sdk/wasp/server/env.ts" + ], + "f3cab17868417ffd4432dc4efecde72ccaaf099a79ddc9194835f3608d123b63" + ], [ [ "file", "../out/sdk/wasp/server/index.ts" ], - "51c3e0802764f72b88f6daaf148dba514ae817e233a40cc9b92ec91784f71f98" + "a8d2ffa7dfd0a13f7fb6135193bcdac1f860603bdd0ddc2843033fd4f6f6151f" ], [ [ @@ -354,7 +382,7 @@ "file", "../out/sdk/wasp/universal/url.ts" ], - "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" + "58ff4ad8ffc79264d7215461571d909f3c5fb177ff32c67058d1da9cd4115d6e" ], [ [ @@ -382,7 +410,7 @@ "file", "Dockerfile" ], - "8851d4e81582d58921a5646dcf063b31dbf8ce9a46f3d4710360d2047dc644b5" + "20694e4dd2e7d96d8752ee3d792d4d8b63c46d7a4505c5312923a749146604b7" ], [ [ @@ -431,7 +459,7 @@ "file", "server/package.json" ], - "a4eb7e59ac5309fc5c39ccd7e19f4fdc7a9a568a3b393f62358ef6a6065d65c3" + "eaaa1e16e4962f38deb7220a7439a26b920ed7f852890242d084b4cebc63b7c3" ], [ [ @@ -440,13 +468,6 @@ ], "c1beb8264f11898364288d73b16f08d1923bac5f70038d9827978deb5b58a2da" ], - [ - [ - "file", - "server/scripts/validate-env.mjs" - ], - "100177b4326ccab7362eff378315d532ad1cc17cd28d1ed5978cb167fd627746" - ], [ [ "file", @@ -480,7 +501,7 @@ "file", "server/src/polyfill.ts" ], - "1149661e0aa7228b184bb2c04ac63232a6523b09b33829db6977f79daba3fd8d" + "f62c2088c8ebf5889ab479bb937ffd8f0f96d3e85483a7b088edebb5ae598dca" ], [ [ @@ -557,7 +578,7 @@ "file", "web-app/package.json" ], - "63ecfca14bd00080f48d3c4e6dff009ddf2777569a07c5e7db647e0384722212" + "adf7fab02235a92502d9fa0e25b76ef5b5096216baef4e89f8573a876446ae74" ], [ [ @@ -580,19 +601,12 @@ ], "434b67f4ee148d6a5c8d88879b616d0af36d71abf193e84ef247e5ab959a13bd" ], - [ - [ - "file", - "web-app/scripts/validate-env.mjs" - ], - "a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd" - ], [ [ "file", "web-app/src/components/DefaultRootErrorBoundary.tsx" ], - "4a141a28ca7aed9daddd75c156f7bae5eec50f3e5a85b6a43a28fa2648f34c44" + "73bbe8a2eb141e523c6b8169c0831e594b4ab6c7207f107d6d20c1561b44373a" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/Dockerfile b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/Dockerfile index 44152eecda..2c775ca6af 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/Dockerfile +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/Dockerfile @@ -50,15 +50,15 @@ WORKDIR /app # Copying the top level 'node_modules' because it contains the Prisma packages # necessary for migrating the database. COPY --from=server-builder /app/node_modules ./node_modules -# Copying the SDK because 'validate-env.mjs' executes independent of the bundle +# Copying the SDK because the server bundle doesn't bundle the SDK # and references the 'wasp' package. COPY --from=server-builder /app/.wasp/out/sdk .wasp/out/sdk -# Copying 'server/node_modules' because 'validate-env.mjs' executes independent -# of the bundle and references the dotenv package. +# Copying 'server/node_modules' because we require dotenv package to +# load environment variables +# TODO: replace dotenv with native Node.js environment variable loading COPY --from=server-builder /app/.wasp/build/server/node_modules .wasp/build/server/node_modules COPY --from=server-builder /app/.wasp/build/server/bundle .wasp/build/server/bundle COPY --from=server-builder /app/.wasp/build/server/package*.json .wasp/build/server/ -COPY --from=server-builder /app/.wasp/build/server/scripts .wasp/build/server/scripts COPY db/ .wasp/build/db/ EXPOSE ${PORT} WORKDIR /app/.wasp/build/server diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/installedNpmDepsLog.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/installedNpmDepsLog.json index a21ddcd4a1..d9bee4d2fa 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/installedNpmDepsLog.json +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/installedNpmDepsLog.json @@ -1 +1 @@ -{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.21.0"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^2.2.1"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"^16.0.2"},{"name":"express","version":"~4.21.0"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"superjson","version":"^2.2.1"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"}]}}} \ No newline at end of file +{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.21.0"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^2.2.1"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"},{"name":"zod","version":"^3.23.8"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"^16.0.2"},{"name":"express","version":"~4.21.0"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"superjson","version":"^2.2.1"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"}]}}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/config.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/config.ts index 82b0f80b6a..fff77cb01c 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/config.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/config.ts @@ -1,6 +1,7 @@ import { stripTrailingSlash } from '../universal/url.js' +import { env } from './env.js' -const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; +const apiUrl = stripTrailingSlash(env.REACT_APP_API_URL) // PUBLIC API export type ClientConfig = { diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/env.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/env.ts new file mode 100644 index 0000000000..8ddab287f7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/env.ts @@ -0,0 +1,18 @@ +import * as z from 'zod' + +import { ensureEnvSchema } from '../env/validation.js' + +const userClientEnvSchema = z.object({}) + +const waspClientEnvSchema = z.object({ + REACT_APP_API_URL: z + .string({ + required_error: 'REACT_APP_API_URL is required', + }) + .default('http://localhost:3001') +}) + +const clientEnvSchema = userClientEnvSchema.merge(waspClientEnvSchema) + +// PUBLIC API +export const env = ensureEnvSchema(import.meta.env, clientEnvSchema) diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/index.ts index cfce564c4d..859f8656b6 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/index.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/index.ts @@ -11,4 +11,7 @@ export enum HttpMethod { export type Route = { method: HttpMethod; path: string } // PUBLIC API -export { config, ClientConfig } from './config' +export { config, ClientConfig } from './config.js' + +// PUBLIC API +export { env } from './env.js' diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/config.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/config.js index 1dffbd68bc..7e6149f386 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/config.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/config.js @@ -1,5 +1,6 @@ import { stripTrailingSlash } from '../universal/url.js'; -const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; +import { env } from './env.js'; +const apiUrl = stripTrailingSlash(env.REACT_APP_API_URL); // PUBLIC API export const config = { apiUrl, diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/config.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/config.js.map index d26d37022b..f9e186b838 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/config.js.map +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAExD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;AAOxD,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/env.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/env.d.ts new file mode 100644 index 0000000000..5a9417a810 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/env.d.ts @@ -0,0 +1,3 @@ +export declare const env: { + REACT_APP_API_URL: string; +}; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/env.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/env.js new file mode 100644 index 0000000000..91164c3768 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/env.js @@ -0,0 +1,14 @@ +import * as z from 'zod'; +import { ensureEnvSchema } from '../env/validation.js'; +const userClientEnvSchema = z.object({}); +const waspClientEnvSchema = z.object({ + REACT_APP_API_URL: z + .string({ + required_error: 'REACT_APP_API_URL is required', + }) + .default('http://localhost:3001') +}); +const clientEnvSchema = userClientEnvSchema.merge(waspClientEnvSchema); +// PUBLIC API +export const env = ensureEnvSchema(import.meta.env, clientEnvSchema); +//# sourceMappingURL=env.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/env.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/env.js.map new file mode 100644 index 0000000000..d230f15c0d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/env.js.map @@ -0,0 +1 @@ +{"version":3,"file":"env.js","sourceRoot":"","sources":["../../client/env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,iBAAiB,EAAE,CAAC;SACjB,MAAM,CAAC;QACN,cAAc,EAAE,+BAA+B;KAChD,CAAC;SACD,OAAO,CAAC,uBAAuB,CAAC;CACpC,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,mBAAmB,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;AAEtE,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.d.ts index 7f5f4bfbc8..6498c439bd 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.d.ts @@ -8,4 +8,5 @@ export type Route = { method: HttpMethod; path: string; }; -export { config, ClientConfig } from './config'; +export { config, ClientConfig } from './config.js'; +export { env } from './env.js'; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.js index 5a7f13dcae..2f4daa7ae3 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.js @@ -8,5 +8,7 @@ export var HttpMethod; HttpMethod["Delete"] = "DELETE"; })(HttpMethod || (HttpMethod = {})); // PUBLIC API -export { config } from './config'; +export { config } from './config.js'; +// PUBLIC API +export { env } from './env.js'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.js.map index 879953c8df..f3611558dc 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.js.map +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,MAAM,EAAgB,MAAM,UAAU,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,MAAM,EAAgB,MAAM,aAAa,CAAA;AAElD,aAAa;AACb,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/index.d.ts new file mode 100644 index 0000000000..d1dafc25fd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/index.d.ts @@ -0,0 +1,3 @@ +import * as z from 'zod'; +export declare function defineEnvValidationSchema>(schema: Schema): Schema; +export { ensureEnvSchema } from './validation.js'; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/index.js new file mode 100644 index 0000000000..17e695d087 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/index.js @@ -0,0 +1,7 @@ +// PUBLIC API +export function defineEnvValidationSchema(schema) { + return schema; +} +// PRIVATE API (SDK, Vite config) +export { ensureEnvSchema } from './validation.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/index.js.map new file mode 100644 index 0000000000..75b4ff7de3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../env/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,MAAM,UAAU,yBAAyB,CACvC,MAAc;IAEd,OAAO,MAAM,CAAA;AACf,CAAC;AAED,iCAAiC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/validation.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/validation.d.ts new file mode 100644 index 0000000000..6bc9d059a3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/validation.d.ts @@ -0,0 +1,2 @@ +import * as z from 'zod'; +export declare function ensureEnvSchema(data: unknown, schema: Schema): z.infer; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/validation.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/validation.js new file mode 100644 index 0000000000..8463eb578e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/validation.js @@ -0,0 +1,23 @@ +import * as z from 'zod'; +const redColor = '\x1b[31m'; +export function ensureEnvSchema(data, schema) { + try { + return schema.parse(data); + } + catch (e) { + if (e instanceof z.ZodError) { + const errorOutput = ['', '══ Env vars validation failed ══', '']; + for (const error of e.errors) { + errorOutput.push(` - ${error.message}`); + } + errorOutput.push(''); + errorOutput.push('════════════════════════════════'); + console.error(redColor, errorOutput.join('\n')); + throw new Error('Error parsing environment variables'); + } + else { + throw e; + } + } +} +//# sourceMappingURL=validation.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/validation.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/validation.js.map new file mode 100644 index 0000000000..1d57b14a0b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/env/validation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../env/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,MAAM,QAAQ,GAAG,UAAU,CAAA;AAE3B,MAAM,UAAU,eAAe,CAC7B,IAAa,EACb,MAAc;IAEd,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;YAC5B,MAAM,WAAW,GAAG,CAAC,EAAE,EAAE,kCAAkC,EAAE,EAAE,CAAC,CAAA;YAChE,KAAK,MAAM,KAAK,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;gBAC7B,WAAW,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;YACzC,CAAC;YACD,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACpB,WAAW,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAA;YACpD,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;YAC/C,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;QACxD,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,CAAA;QACT,CAAC;IACH,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js.map index 8163354e1b..462e1c1811 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js.map +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js.map @@ -1 +1 @@ -{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,OAAsB;QACvG,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YACE,UAAkB,EAClB,OAAgB,EAChB,IAA8B,EAC9B,OAAsB;QAEtB,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IACE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EACxE,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.d.ts index 68bb448c56..70f438bdf0 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.d.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.d.ts @@ -1,16 +1,13 @@ -type BaseConfig = { - allowedCORSOrigins: string | string[]; -}; -type CommonConfig = BaseConfig & { - env: string; +import { env } from './env.js'; +type NodeEnv = typeof env.NODE_ENV; +type Config = { + env: NodeEnv; isDevelopment: boolean; port: number; - databaseUrl: string | undefined; -}; -type EnvConfig = BaseConfig & { + databaseUrl: string; frontendUrl: string; serverUrl: string; + allowedCORSOrigins: string | string[]; }; -type Config = CommonConfig & EnvConfig; -declare const resolvedConfig: Config; -export default resolvedConfig; +declare const config: Config; +export default config; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js index e4f89082c8..dcc80722ab 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js @@ -1,43 +1,21 @@ -var _a; -import merge from 'lodash.merge'; -import { stripTrailingSlash } from "../universal/url.js"; -const nodeEnv = (_a = process.env.NODE_ENV) !== null && _a !== void 0 ? _a : 'development'; +import { env } from './env.js'; +import { stripTrailingSlash } from '../universal/url.js'; +const frontendUrl = stripTrailingSlash(env.WASP_WEB_CLIENT_URL); +const serverUrl = stripTrailingSlash(env.WASP_SERVER_URL); +const allowedCORSOriginsPerEnv = { + development: '*', + production: [frontendUrl] +}; +const allowedCORSOrigins = allowedCORSOriginsPerEnv[env.NODE_ENV]; const config = { - all: { - env: nodeEnv, - isDevelopment: nodeEnv === 'development', - port: process.env.PORT ? parseInt(process.env.PORT) : 3001, - databaseUrl: process.env.DATABASE_URL, - allowedCORSOrigins: [], - }, - development: getDevelopmentConfig(), - production: getProductionConfig(), + frontendUrl, + serverUrl, + allowedCORSOrigins, + env: env.NODE_ENV, + isDevelopment: env.NODE_ENV === 'development', + port: env.PORT, + databaseUrl: env.DATABASE_URL, }; -const resolvedConfig = merge(config.all, config[nodeEnv]); // PUBLIC API -export default resolvedConfig; -function getDevelopmentConfig() { - var _a, _b; - const frontendUrl = stripTrailingSlash((_a = process.env.WASP_WEB_CLIENT_URL) !== null && _a !== void 0 ? _a : 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash((_b = process.env.WASP_SERVER_URL) !== null && _b !== void 0 ? _b : 'http://localhost:3001'); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - allowedCORSOrigins: '*', - }; -} -function getProductionConfig() { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - // @ts-ignore - allowedCORSOrigins: [frontendUrl], - }; -} +export default config; //# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js.map index e284580bbd..9fd077fa81 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js.map +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,mCAAI,aAAa,CAAA;AAyBrD,MAAM,MAAM,GAIR;IACF,GAAG,EAAE;QACH,GAAG,EAAE,OAAO;QACZ,aAAa,EAAE,OAAO,KAAK,aAAa;QACxC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;QAC1D,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;KACvB;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;CAClC,CAAA;AAED,MAAM,cAAc,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACjE,aAAa;AACb,eAAe,cAAc,CAAA;AAE7B,SAAS,oBAAoB;;IAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,mBAAmB,mCAAI,wBAAwB,CAAC,CAAC;IACpG,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,eAAe,mCAAI,uBAAuB,CAAC,CAAC;IAC7F,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,kBAAkB,EAAE,GAAG;KACxB,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAClE,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,aAAa;QACb,kBAAkB,EAAE,CAAC,WAAW,CAAC;KAClC,CAAA;AACH,CAAC"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAcxD,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;AAC/D,MAAM,SAAS,GAAG,kBAAkB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;AAEzD,MAAM,wBAAwB,GAAuC;IACnE,WAAW,EAAE,GAAG;IAChB,UAAU,EAAE,CAAC,WAAW,CAAC;CAC1B,CAAA;AACD,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAEjE,MAAM,MAAM,GAAW;IACrB,WAAW;IACX,SAAS;IACT,kBAAkB;IAClB,GAAG,EAAE,GAAG,CAAC,QAAQ;IACjB,aAAa,EAAE,GAAG,CAAC,QAAQ,KAAK,aAAa;IAC7C,IAAI,EAAE,GAAG,CAAC,IAAI;IACd,WAAW,EAAE,GAAG,CAAC,YAAY;CAC9B,CAAA;AAED,aAAa;AACb,eAAe,MAAM,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/env.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/env.d.ts new file mode 100644 index 0000000000..667ea30e35 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/env.d.ts @@ -0,0 +1,17 @@ +export declare const env: { + PORT: number; + DATABASE_URL: string; + SKIP_EMAIL_VERIFICATION_IN_DEV: boolean; + NODE_ENV: "development"; + WASP_SERVER_URL: string; + WASP_WEB_CLIENT_URL: string; + PG_BOSS_NEW_OPTIONS?: string | undefined; +} | { + PORT: number; + DATABASE_URL: string; + SKIP_EMAIL_VERIFICATION_IN_DEV: boolean; + NODE_ENV: "production"; + WASP_SERVER_URL: string; + WASP_WEB_CLIENT_URL: string; + PG_BOSS_NEW_OPTIONS?: string | undefined; +}; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/env.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/env.js new file mode 100644 index 0000000000..1bfc3e0b6e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/env.js @@ -0,0 +1,55 @@ +import * as z from 'zod'; +import { ensureEnvSchema } from '../env/validation.js'; +const userServerEnvSchema = z.object({}); +const waspServerCommonSchema = z.object({ + PORT: z.coerce.number().default(3001), + DATABASE_URL: z.string({ + required_error: 'DATABASE_URL is required', + }), + PG_BOSS_NEW_OPTIONS: z.string().optional(), + SKIP_EMAIL_VERIFICATION_IN_DEV: z + .enum(['true', 'false'], { + message: 'SKIP_EMAIL_VERIFICATION_IN_DEV must be either "true" or "false"', + }) + .transform((value) => value === 'true') + .default('false'), +}); +const serverUrlSchema = z + .string({ + required_error: 'WASP_SERVER_URL is required', +}) + .url({ + message: 'WASP_SERVER_URL must be a valid URL', +}); +const clientUrlSchema = z + .string({ + required_error: 'WASP_WEB_CLIENT_URL is required', +}) + .url({ + message: 'WASP_WEB_CLIENT_URL must be a valid URL', +}); +// In development, we provide default values for some environment variables +// to make the development process easier. +const serverDevSchema = z.object({ + NODE_ENV: z.literal('development'), + WASP_SERVER_URL: serverUrlSchema + .default('http://localhost:3001'), + WASP_WEB_CLIENT_URL: clientUrlSchema + .default('http://localhost:3000/'), +}); +const serverProdSchema = z.object({ + NODE_ENV: z.literal('production'), + WASP_SERVER_URL: serverUrlSchema, + WASP_WEB_CLIENT_URL: clientUrlSchema, +}); +const serverCommonSchema = userServerEnvSchema.merge(waspServerCommonSchema); +const serverEnvSchema = z.discriminatedUnion('NODE_ENV', [ + serverDevSchema.merge(serverCommonSchema), + serverProdSchema.merge(serverCommonSchema) +]); +// PUBLIC API +export const env = ensureEnvSchema(process.env, serverEnvSchema); +function getRequiredEnvVarErrorMessage(featureName, envVarName) { + return `${envVarName} is required when using ${featureName}`; +} +//# sourceMappingURL=env.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/env.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/env.js.map new file mode 100644 index 0000000000..3dfa10e116 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/env.js.map @@ -0,0 +1 @@ +{"version":3,"file":"env.js","sourceRoot":"","sources":["../../server/env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACrC,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC;QACrB,cAAc,EAAE,0BAA0B;KAC3C,CAAC;IACF,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,8BAA8B,EAAE,CAAC;SAC9B,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACvB,OAAO,EAAE,iEAAiE;KAC3E,CAAC;SACD,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,MAAM,CAAC;SACtC,OAAO,CAAC,OAAO,CAAC;CACpB,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,CAAC;KACtB,MAAM,CAAC;IACN,cAAc,EAAE,6BAA6B;CAC9C,CAAC;KACD,GAAG,CAAC;IACH,OAAO,EAAE,qCAAqC;CAC/C,CAAC,CAAA;AAEJ,MAAM,eAAe,GAAG,CAAC;KACtB,MAAM,CAAC;IACN,cAAc,EAAE,iCAAiC;CAClD,CAAC;KACD,GAAG,CAAC;IACH,OAAO,EAAE,yCAAyC;CACnD,CAAC,CAAA;AAGJ,2EAA2E;AAC3E,0CAA0C;AAC1C,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAClC,eAAe,EAAE,eAAe;SAC7B,OAAO,CAAC,uBAAuB,CAAC;IACnC,mBAAmB,EAAE,eAAe;SACjC,OAAO,CAAC,wBAAwB,CAAC;CACrC,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IACjC,eAAe,EAAE,eAAe;IAChC,mBAAmB,EAAE,eAAe;CACrC,CAAC,CAAA;AAEF,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;AAC5E,MAAM,eAAe,GAAG,CAAC,CAAC,kBAAkB,CAAC,UAAU,EAAE;IACvD,eAAe,CAAC,KAAK,CAAC,kBAAkB,CAAC;IACzC,gBAAgB,CAAC,KAAK,CAAC,kBAAkB,CAAC;CAC3C,CAAC,CAAA;AAEF,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,eAAe,CAAC,CAAA;AAEhE,SAAS,6BAA6B,CAAC,WAAmB,EAAE,UAAkB;IAC5E,OAAO,GAAG,UAAU,2BAA2B,WAAW,EAAE,CAAA;AAC9D,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.d.ts index dee9613a53..a108f6123f 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.d.ts @@ -4,4 +4,5 @@ export { default as prisma } from './dbClient.js'; export { type ServerSetupFn } from './types/index.js'; export { HttpError } from './HttpError.js'; export { MiddlewareConfigFn } from './middleware/index.js'; +export { env } from './env.js'; export type DbSeedFn = (prisma: PrismaClient) => Promise; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.js index 0e53e0deab..8e75e6f78c 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.js @@ -4,4 +4,6 @@ export { default as config } from './config.js'; export { default as prisma } from './dbClient.js'; // PUBLIC API export { HttpError } from './HttpError.js'; +// PUBLIC API +export { env } from './env.js'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.js.map index b84ac1b303..87ed22f3af 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.js.map +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAA;AAC/C,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,eAAe,CAAA;AAGjD,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAA;AAC/C,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,eAAe,CAAA;AAGjD,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAG1C,aAAa;AACb,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/url.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/url.d.ts index aa893e7838..7ceb994694 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/url.d.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/url.d.ts @@ -1 +1,2 @@ -export declare function stripTrailingSlash(url?: string): string | undefined; +export declare function stripTrailingSlash(url: string): string; +export declare function stripTrailingSlash(url: undefined): undefined; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/url.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/url.js.map index a7bad96020..e236f1b977 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/url.js.map +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/url.js.map @@ -1 +1 @@ -{"version":3,"file":"url.js","sourceRoot":"","sources":["../../universal/url.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC3C,OAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC"} \ No newline at end of file +{"version":3,"file":"url.js","sourceRoot":"","sources":["../../universal/url.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC3C,OAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/env/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/env/index.ts new file mode 100644 index 0000000000..4c783125c1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/env/index.ts @@ -0,0 +1,11 @@ +import * as z from 'zod' + +// PUBLIC API +export function defineEnvValidationSchema>( + schema: Schema, +): Schema { + return schema +} + +// PRIVATE API (SDK, Vite config) +export { ensureEnvSchema } from './validation.js' diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/env/validation.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/env/validation.ts new file mode 100644 index 0000000000..a5bc334754 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/env/validation.ts @@ -0,0 +1,25 @@ +import * as z from 'zod' + +const redColor = '\x1b[31m' + +export function ensureEnvSchema( + data: unknown, + schema: Schema +): z.infer { + try { + return schema.parse(data) + } catch (e) { + if (e instanceof z.ZodError) { + const errorOutput = ['', '══ Env vars validation failed ══', ''] + for (const error of e.errors) { + errorOutput.push(` - ${error.message}`) + } + errorOutput.push('') + errorOutput.push('════════════════════════════════') + console.error(redColor, errorOutput.join('\n')) + throw new Error('Error parsing environment variables') + } else { + throw e + } + } +} diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/package.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/package.json index 2589c5362f..55c07a5084 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/package.json +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/package.json @@ -8,7 +8,6 @@ "axios": "^1.4.0", "express": "~4.21.0", "jsdom": "^21.1.1", - "lodash.merge": "^4.6.2", "mitt": "3.0.0", "msw": "^1.1.0", "prisma": "5.19.1", @@ -16,7 +15,8 @@ "react-hook-form": "^7.45.4", "react-router-dom": "^6.26.2", "superjson": "^2.2.1", - "vitest": "^1.2.1" + "vitest": "^1.2.1", + "zod": "^3.23.8" }, "devDependencies": { "@tsconfig/node18": "latest", @@ -51,6 +51,7 @@ "./core/storage": "./dist/core/storage.js", "./dev": "./dist/dev/index.js", "./entities": "./dist/entities/index.js", + "./env": "./dist/env/index.js", "./ext-src/*": "./dist/ext-src/*.js", "./operations": "./dist/operations/index.js", "./operations/*": "./dist/operations/*", diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/HttpError.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/HttpError.ts index d05a2c841b..bce964712d 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/HttpError.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/HttpError.ts @@ -2,7 +2,12 @@ export class HttpError extends Error { public statusCode: number public data: unknown - constructor (statusCode: number, message?: string, data?: Record, options?: ErrorOptions) { + constructor( + statusCode: number, + message?: string, + data?: Record, + options?: ErrorOptions + ) { super(message, options) if (Error.captureStackTrace) { @@ -11,7 +16,9 @@ export class HttpError extends Error { this.name = this.constructor.name - if (!(Number.isInteger(statusCode) && statusCode >= 400 && statusCode < 600)) { + if ( + !(Number.isInteger(statusCode) && statusCode >= 400 && statusCode < 600) + ) { throw new Error('statusCode has to be integer in range [400, 600).') } this.statusCode = statusCode diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/config.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/config.ts index 1dc9bafb93..3a000a897f 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/config.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/config.ts @@ -1,73 +1,36 @@ -import merge from 'lodash.merge' +import { env } from './env.js' +import { stripTrailingSlash } from '../universal/url.js' -import { stripTrailingSlash } from "../universal/url.js"; +type NodeEnv = typeof env.NODE_ENV -const nodeEnv = process.env.NODE_ENV ?? 'development' - -// TODO: -// - Use dotenv library to consume env vars from a file. -// - Use convict library to define schema and validate env vars. -// https://codingsans.com/blog/node-config-best-practices - -type BaseConfig = { - allowedCORSOrigins: string | string[]; -} - -type CommonConfig = BaseConfig & { - env: string; +type Config = { + env: NodeEnv; isDevelopment: boolean; port: number; - databaseUrl: string | undefined; -} - -type EnvConfig = BaseConfig & { + databaseUrl: string; frontendUrl: string; serverUrl: string; + allowedCORSOrigins: string | string[]; } -type Config = CommonConfig & EnvConfig +const frontendUrl = stripTrailingSlash(env.WASP_WEB_CLIENT_URL) +const serverUrl = stripTrailingSlash(env.WASP_SERVER_URL) -const config: { - all: CommonConfig, - development: EnvConfig, - production: EnvConfig, -} = { - all: { - env: nodeEnv, - isDevelopment: nodeEnv === 'development', - port: process.env.PORT ? parseInt(process.env.PORT) : 3001, - databaseUrl: process.env.DATABASE_URL, - allowedCORSOrigins: [], - }, - development: getDevelopmentConfig(), - production: getProductionConfig(), +const allowedCORSOriginsPerEnv: Record = { + development: '*', + production: [frontendUrl] } - -const resolvedConfig: Config = merge(config.all, config[nodeEnv]) -// PUBLIC API -export default resolvedConfig - -function getDevelopmentConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL ?? 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL ?? 'http://localhost:3001'); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - allowedCORSOrigins: '*', - } +const allowedCORSOrigins = allowedCORSOriginsPerEnv[env.NODE_ENV] + +const config: Config = { + frontendUrl, + serverUrl, + allowedCORSOrigins, + env: env.NODE_ENV, + isDevelopment: env.NODE_ENV === 'development', + port: env.PORT, + databaseUrl: env.DATABASE_URL, } -function getProductionConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - // @ts-ignore - allowedCORSOrigins: [frontendUrl], - } -} +// PUBLIC API +export default config diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/env.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/env.ts new file mode 100644 index 0000000000..c1bd8f5c0f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/env.ts @@ -0,0 +1,65 @@ +import * as z from 'zod' + +import { ensureEnvSchema } from '../env/validation.js' + +const userServerEnvSchema = z.object({}) + +const waspServerCommonSchema = z.object({ + PORT: z.coerce.number().default(3001), + DATABASE_URL: z.string({ + required_error: 'DATABASE_URL is required', + }), + PG_BOSS_NEW_OPTIONS: z.string().optional(), + SKIP_EMAIL_VERIFICATION_IN_DEV: z + .enum(['true', 'false'], { + message: 'SKIP_EMAIL_VERIFICATION_IN_DEV must be either "true" or "false"', + }) + .transform((value) => value === 'true') + .default('false'), +}) + +const serverUrlSchema = z + .string({ + required_error: 'WASP_SERVER_URL is required', + }) + .url({ + message: 'WASP_SERVER_URL must be a valid URL', + }) + +const clientUrlSchema = z + .string({ + required_error: 'WASP_WEB_CLIENT_URL is required', + }) + .url({ + message: 'WASP_WEB_CLIENT_URL must be a valid URL', + }) + + +// In development, we provide default values for some environment variables +// to make the development process easier. +const serverDevSchema = z.object({ + NODE_ENV: z.literal('development'), + WASP_SERVER_URL: serverUrlSchema + .default('http://localhost:3001'), + WASP_WEB_CLIENT_URL: clientUrlSchema + .default('http://localhost:3000/'), +}) + +const serverProdSchema = z.object({ + NODE_ENV: z.literal('production'), + WASP_SERVER_URL: serverUrlSchema, + WASP_WEB_CLIENT_URL: clientUrlSchema, +}) + +const serverCommonSchema = userServerEnvSchema.merge(waspServerCommonSchema) +const serverEnvSchema = z.discriminatedUnion('NODE_ENV', [ + serverDevSchema.merge(serverCommonSchema), + serverProdSchema.merge(serverCommonSchema) +]) + +// PUBLIC API +export const env = ensureEnvSchema(process.env, serverEnvSchema) + +function getRequiredEnvVarErrorMessage(featureName: string, envVarName: string) { + return `${envVarName} is required when using ${featureName}` +} diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/index.ts index 535077900b..0f95deb90a 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/index.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/index.ts @@ -10,6 +10,8 @@ export { type ServerSetupFn } from './types/index.js' export { HttpError } from './HttpError.js' // PUBLIC API export { MiddlewareConfigFn } from './middleware/index.js' +// PUBLIC API +export { env } from './env.js' // PUBLIC API export type DbSeedFn = (prisma: PrismaClient) => Promise diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/url.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/url.ts index d21c06c65c..126678dac9 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/url.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/url.ts @@ -1,3 +1,5 @@ +export function stripTrailingSlash(url: string): string +export function stripTrailingSlash(url: undefined): undefined export function stripTrailingSlash(url?: string): string | undefined { return url?.replace(/\/$/, ""); } 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 7a57413e11..51ec87354a 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 @@ -34,9 +34,8 @@ "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", - "start": "npm run validate-env && node --enable-source-maps -r dotenv/config bundle/server.js", + "start": "node --enable-source-maps -r dotenv/config bundle/server.js", "start-production": "NODE_ENV=production npm run start", - "validate-env": "node -r dotenv/config ./scripts/validate-env.mjs", "watch": "nodemon --exec 'npm run bundle-and-start || exit 1'" }, "type": "module", diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/scripts/validate-env.mjs deleted file mode 100644 index f6e50aceca..0000000000 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/scripts/validate-env.mjs +++ /dev/null @@ -1,5 +0,0 @@ -import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; - -console.info("🔍 Validating environment variables..."); -throwIfNotValidAbsoluteURL(process.env.WASP_WEB_CLIENT_URL, 'Environment variable WASP_WEB_CLIENT_URL'); -throwIfNotValidAbsoluteURL(process.env.WASP_SERVER_URL, 'Environment variable WASP_SERVER_URL'); diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/polyfill.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/polyfill.ts index 7931d12eb0..9279daf6da 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/polyfill.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/server/src/polyfill.ts @@ -1,11 +1,10 @@ // This is a polyfill for Node.js 18 webcrypto API so Lucia can use it // for random number generation. -import { webcrypto } from "node:crypto"; +import { webcrypto } from 'node:crypto' // NOTE: node < 19 doesn't have Crypto API, which we need for Lucia, so we apply the polyfill if Crypto API is not defined. -if (typeof globalThis.crypto === "undefined") { +if (typeof globalThis.crypto === 'undefined') { // @ts-ignore - globalThis.crypto = webcrypto as Crypto; + globalThis.crypto = webcrypto as Crypto } - diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/package.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/package.json index c62763be23..3a28ba8e99 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/package.json +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/package.json @@ -18,8 +18,7 @@ "devDependencies": { "@tsconfig/vite-react": "^2.0.0", "@types/react-dom": "^18.0.11", - "@vitejs/plugin-react": "^4.2.1", - "dotenv": "^16.0.3" + "@vitejs/plugin-react": "^4.2.1" }, "engineStrict": true, "engines": { @@ -28,9 +27,8 @@ "name": "waspCompile", "private": true, "scripts": { - "build": "npm run validate-env && tsc && vite build", - "start": "npm run validate-env && vite", - "validate-env": "node -r dotenv/config ./scripts/validate-env.mjs" + "build": "tsc && vite build", + "start": "vite" }, "type": "module", "version": "0.0.0" diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/scripts/validate-env.mjs deleted file mode 100644 index 18ee507c9e..0000000000 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/scripts/validate-env.mjs +++ /dev/null @@ -1,4 +0,0 @@ -import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; - -console.info("🔍 Validating environment variables..."); -throwIfNotValidAbsoluteURL(process.env.REACT_APP_API_URL, 'Environemnt variable REACT_APP_API_URL'); diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx index 7af24e15d6..1e931935e6 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx @@ -7,7 +7,10 @@ export function DefaultRootErrorBoundary() { console.error(error) return ( -
There was an error rendering this page. Check the browser console for more information.
+
+ There was an error rendering this page. Check the browser console for + more information. +
) } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest b/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest index 42ed7f7d09..c2aa1b83ea 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest @@ -37,6 +37,7 @@ waspComplexTest/.wasp/out/sdk/wasp/client/config.ts waspComplexTest/.wasp/out/sdk/wasp/client/crud/index.ts waspComplexTest/.wasp/out/sdk/wasp/client/crud/operationsHelpers.ts waspComplexTest/.wasp/out/sdk/wasp/client/crud/tasks.ts +waspComplexTest/.wasp/out/sdk/wasp/client/env.ts waspComplexTest/.wasp/out/sdk/wasp/client/index.ts waspComplexTest/.wasp/out/sdk/wasp/client/operations/actions/core.ts waspComplexTest/.wasp/out/sdk/wasp/client/operations/actions/index.ts @@ -155,6 +156,9 @@ waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/operationsHelpers.js.map waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.d.ts waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.js waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/client/env.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/client/env.js +waspComplexTest/.wasp/out/sdk/wasp/dist/client/env.js.map waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.d.ts waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js.map @@ -224,6 +228,12 @@ waspComplexTest/.wasp/out/sdk/wasp/dist/dev/index.js.map waspComplexTest/.wasp/out/sdk/wasp/dist/entities/index.d.ts waspComplexTest/.wasp/out/sdk/wasp/dist/entities/index.js waspComplexTest/.wasp/out/sdk/wasp/dist/entities/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/env/index.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/env/index.js +waspComplexTest/.wasp/out/sdk/wasp/dist/env/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/env/validation.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/env/validation.js +waspComplexTest/.wasp/out/sdk/wasp/dist/env/validation.js.map waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx waspComplexTest/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map @@ -278,9 +288,6 @@ waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/hooks.js.map waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.d.ts waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js.map -waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/env.d.ts -waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/env.js -waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/env.js.map waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/index.d.ts waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/index.js waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/index.js.map @@ -326,6 +333,9 @@ waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/core/types.js.map waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.d.ts waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/server/env.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/server/env.js +waspComplexTest/.wasp/out/sdk/wasp/dist/server/env.js.map waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.d.ts waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js.map @@ -396,6 +406,8 @@ waspComplexTest/.wasp/out/sdk/wasp/dist/universal/validators.d.ts waspComplexTest/.wasp/out/sdk/wasp/dist/universal/validators.js waspComplexTest/.wasp/out/sdk/wasp/dist/universal/validators.js.map waspComplexTest/.wasp/out/sdk/wasp/entities/index.ts +waspComplexTest/.wasp/out/sdk/wasp/env/index.ts +waspComplexTest/.wasp/out/sdk/wasp/env/validation.ts waspComplexTest/.wasp/out/sdk/wasp/ext-src/Main.css waspComplexTest/.wasp/out/sdk/wasp/ext-src/MainPage.jsx waspComplexTest/.wasp/out/sdk/wasp/ext-src/auth/hooks.ts @@ -419,7 +431,6 @@ waspComplexTest/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts waspComplexTest/.wasp/out/sdk/wasp/server/api/index.ts waspComplexTest/.wasp/out/sdk/wasp/server/auth/hooks.ts waspComplexTest/.wasp/out/sdk/wasp/server/auth/index.ts -waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/env.ts waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/index.ts waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/oneTimeCode.ts waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/provider.ts @@ -435,6 +446,7 @@ waspComplexTest/.wasp/out/sdk/wasp/server/email/core/index.ts waspComplexTest/.wasp/out/sdk/wasp/server/email/core/providers/sendgrid.ts waspComplexTest/.wasp/out/sdk/wasp/server/email/core/types.ts waspComplexTest/.wasp/out/sdk/wasp/server/email/index.ts +waspComplexTest/.wasp/out/sdk/wasp/server/env.ts waspComplexTest/.wasp/out/sdk/wasp/server/index.ts waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/job.ts waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/index.ts @@ -466,7 +478,6 @@ waspComplexTest/.wasp/out/server/README.md waspComplexTest/.wasp/out/server/nodemon.json waspComplexTest/.wasp/out/server/package.json waspComplexTest/.wasp/out/server/rollup.config.js -waspComplexTest/.wasp/out/server/scripts/validate-env.mjs waspComplexTest/.wasp/out/server/src/actions/mySpecialAction.ts waspComplexTest/.wasp/out/server/src/app.js waspComplexTest/.wasp/out/server/src/auth/hooks.ts @@ -509,7 +520,6 @@ waspComplexTest/.wasp/out/web-app/package.json waspComplexTest/.wasp/out/web-app/public/.gitkeep waspComplexTest/.wasp/out/web-app/public/favicon.ico waspComplexTest/.wasp/out/web-app/public/manifest.json -waspComplexTest/.wasp/out/web-app/scripts/validate-env.mjs waspComplexTest/.wasp/out/web-app/src/auth/pages/OAuthCallback.tsx waspComplexTest/.wasp/out/web-app/src/auth/pages/createAuthRequiredPage.jsx waspComplexTest/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx 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 f7ea36a433..812cd8b410 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 @@ -200,7 +200,7 @@ "file", "../out/sdk/wasp/client/config.ts" ], - "d94e8bee5fd8f6793b511652b9ee558e57f4913595763137a5385cd929648168" + "4c5835ad64352cc87a4a17e41fd70333bc0d1eedd7339d7ad3d3507cdb64038d" ], [ [ @@ -223,12 +223,19 @@ ], "083c93c278fe261989cec8a4ea52e0dc706fae1a79aa91d6f1b8c17eca938c40" ], + [ + [ + "file", + "../out/sdk/wasp/client/env.ts" + ], + "2a3602d40b299fbfa1a6275fe67828d5653d9f3265ba8204b75178aa41dcbae0" + ], [ [ "file", "../out/sdk/wasp/client/index.ts" ], - "2b3651e7040a63cfd6a271c2aa89f21cf01170e0abeb6c5ab74adde324852fe4" + "b55e5c34c2fdb50e608bcb4331fa2e67724f1fbfb21e1b93680b0f5fe2b7005a" ], [ [ @@ -384,6 +391,20 @@ ], "becac9b39c6920dee40a97958331da143e06dd26d6756ad08dcc6402b23e2efb" ], + [ + [ + "file", + "../out/sdk/wasp/env/index.ts" + ], + "d92b4832e9d4249ae5b1f00c0f9760d6841aa44bc199550414793a1d57a6845e" + ], + [ + [ + "file", + "../out/sdk/wasp/env/validation.ts" + ], + "e22b2fb8931275d3b1bd3176cbdbf753d22fc61887ded0e93cd8febf1b97d260" + ], [ [ "file", @@ -487,7 +508,7 @@ "file", "../out/sdk/wasp/package.json" ], - "6fdae74af8f40e1e3287c93d6af2a7ebe9140b1995b6511d2bb4a0c002ab8d48" + "f481b1b2cb68f26b7496bfcc92dfd80958fb01b013853f9fd1a36672a117acd8" ], [ [ @@ -501,7 +522,7 @@ "file", "../out/sdk/wasp/server/HttpError.ts" ], - "f375fb45eeb16381b8cc575503db302c005ddaa1b35d837ca0ea043fe8ec6ccb" + "9c1b2449d8e9d68470c6014054a3c3074069a104ddb291b9089c30d624a2d9d9" ], [ [ @@ -545,13 +566,6 @@ ], "6daa9ed1d7ad0875bd5772a440de2fd229e9cd1bf3f44bde548eff467a68116d" ], - [ - [ - "file", - "../out/sdk/wasp/server/auth/oauth/env.ts" - ], - "50416a8c284fdbb3952e21e1617da2270b99dba717023babc7c32f5b12a63a32" - ], [ [ "file", @@ -571,14 +585,14 @@ "file", "../out/sdk/wasp/server/auth/oauth/provider.ts" ], - "2a2015d905a2ceddb45ff1034b283b242df153ddf2cabd05fddd4746365622df" + "f286a5c5f04b197bc5cf21711722b6265887dae1782a26e41124606616c27122" ], [ [ "file", "../out/sdk/wasp/server/auth/oauth/providers/google.ts" ], - "2a30b51f7be3a627d652e164669b01832345763597aa1e0badf7d321ccdc3bdb" + "42fe943be534df3df054480df3c3672742159a5f9d48a5a2bb0cb0a3500168e7" ], [ [ @@ -599,7 +613,7 @@ "file", "../out/sdk/wasp/server/config.ts" ], - "7222022fceced6be8ce57e8fd06ea6dfe2100de5984d7a9bc752ed4d9ba6f4ef" + "4a78cfcf41a4fa41fa61ee19404fb6f32d5c25a1f854008ad81fcd8c2191e5ab" ], [ [ @@ -655,14 +669,21 @@ "file", "../out/sdk/wasp/server/email/index.ts" ], - "7fc9cea5624d921d9cd2397767522282e3f1a8a0013806f8d3e721560526b177" + "199b8d91048f446e0491964c9dfe0e946875a19b9a5757aa7e600880d6f52f98" + ], + [ + [ + "file", + "../out/sdk/wasp/server/env.ts" + ], + "0331823b6ac18abf1acee809ba959500362c3cf7bf9b258516da0067c156c84c" ], [ [ "file", "../out/sdk/wasp/server/index.ts" ], - "51c3e0802764f72b88f6daaf148dba514ae817e233a40cc9b92ec91784f71f98" + "a8d2ffa7dfd0a13f7fb6135193bcdac1f860603bdd0ddc2843033fd4f6f6151f" ], [ [ @@ -683,7 +704,7 @@ "file", "../out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts" ], - "4c405b3cf98a4cea0ee906a46e4676ebe7ce08c1652c1b502403a93ebbbf943a" + "44ea6eb19cb4e283e24b4d3da1105539ef81cd36dfeb71d9fa5695f0b0c15b34" ], [ [ @@ -816,7 +837,7 @@ "file", "../out/sdk/wasp/universal/url.ts" ], - "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" + "58ff4ad8ffc79264d7215461571d909f3c5fb177ff32c67058d1da9cd4115d6e" ], [ [ @@ -844,7 +865,7 @@ "file", "Dockerfile" ], - "db2dae70d212749a7e758117e55f00968f84974d8307dc7d33154bf1429486c2" + "94b45c62cbed2fcb04c69643da5047c27c5eb0acb78b7c164d083a5c30e7c1d1" ], [ [ @@ -893,7 +914,7 @@ "file", "server/package.json" ], - "00ae054bb5597a45cc4e5277f88d24f4399fccabaa3614bf6ea89424fcd23480" + "ddda728300aaca5ccbd8342479cede7930cd5841c01f048415da8172314a1e0a" ], [ [ @@ -902,13 +923,6 @@ ], "c1beb8264f11898364288d73b16f08d1923bac5f70038d9827978deb5b58a2da" ], - [ - [ - "file", - "server/scripts/validate-env.mjs" - ], - "100177b4326ccab7362eff378315d532ad1cc17cd28d1ed5978cb167fd627746" - ], [ [ "file", @@ -956,7 +970,7 @@ "file", "server/src/auth/providers/oauth/cookies.ts" ], - "7fb6658564e8af442d0f0b5874879e6788e91e89d98a8265621dd323135f5916" + "d3550ba07c6685f033962a47b326609f3a15ab5456638b9a4cf6fbb84379044c" ], [ [ @@ -1047,7 +1061,7 @@ "file", "server/src/polyfill.ts" ], - "1149661e0aa7228b184bb2c04ac63232a6523b09b33829db6977f79daba3fd8d" + "f62c2088c8ebf5889ab479bb937ffd8f0f96d3e85483a7b088edebb5ae598dca" ], [ [ @@ -1187,7 +1201,7 @@ "file", "web-app/package.json" ], - "7e7cce9cb193df0ebb8cfe1ffc9b62b4d6aefe2d74c8631d8dcca45a21fff77a" + "c424e09513b200091c5b0c6e73de89a4987657060c796e203f474bfda83dadd7" ], [ [ @@ -1210,13 +1224,6 @@ ], "b57981d1636058192ae6057166991125031f519f24c0a0711ef16dc73958e51a" ], - [ - [ - "file", - "web-app/scripts/validate-env.mjs" - ], - "a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd" - ], [ [ "file", @@ -1236,7 +1243,7 @@ "file", "web-app/src/components/DefaultRootErrorBoundary.tsx" ], - "4a141a28ca7aed9daddd75c156f7bae5eec50f3e5a85b6a43a28fa2648f34c44" + "73bbe8a2eb141e523c6b8169c0831e594b4ab6c7207f107d6d20c1561b44373a" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/Dockerfile b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/Dockerfile index 76baedb0e0..9d828590a3 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/Dockerfile +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/Dockerfile @@ -52,15 +52,15 @@ WORKDIR /app # Copying the top level 'node_modules' because it contains the Prisma packages # necessary for migrating the database. COPY --from=server-builder /app/node_modules ./node_modules -# Copying the SDK because 'validate-env.mjs' executes independent of the bundle +# Copying the SDK because the server bundle doesn't bundle the SDK # and references the 'wasp' package. COPY --from=server-builder /app/.wasp/out/sdk .wasp/out/sdk -# Copying 'server/node_modules' because 'validate-env.mjs' executes independent -# of the bundle and references the dotenv package. +# Copying 'server/node_modules' because we require dotenv package to +# load environment variables +# TODO: replace dotenv with native Node.js environment variable loading COPY --from=server-builder /app/.wasp/build/server/node_modules .wasp/build/server/node_modules COPY --from=server-builder /app/.wasp/build/server/bundle .wasp/build/server/bundle COPY --from=server-builder /app/.wasp/build/server/package*.json .wasp/build/server/ -COPY --from=server-builder /app/.wasp/build/server/scripts .wasp/build/server/scripts COPY db/ .wasp/build/db/ EXPOSE ${PORT} WORKDIR /app/.wasp/build/server diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/installedNpmDepsLog.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/installedNpmDepsLog.json index 800ff0bab9..d18d6662d0 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/installedNpmDepsLog.json +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/installedNpmDepsLog.json @@ -1 +1 @@ -{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.21.0"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^2.2.1"},{"name":"@stitches/react","version":"^1.2.8"},{"name":"@node-rs/argon2","version":"^1.8.3"},{"name":"arctic","version":"^1.2.1"},{"name":"lucia","version":"^3.0.1"},{"name":"oslo","version":"^1.1.2"},{"name":"@lucia-auth/adapter-prisma","version":"^4.0.0"},{"name":"@sendgrid/mail","version":"^7.7.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"},{"name":"pg-boss","version":"^8.4.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"^16.0.2"},{"name":"express","version":"~4.21.0"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"superjson","version":"^2.2.1"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"}]}}} \ No newline at end of file +{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.21.0"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^2.2.1"},{"name":"@stitches/react","version":"^1.2.8"},{"name":"@node-rs/argon2","version":"^1.8.3"},{"name":"arctic","version":"^1.2.1"},{"name":"lucia","version":"^3.0.1"},{"name":"oslo","version":"^1.1.2"},{"name":"@lucia-auth/adapter-prisma","version":"^4.0.0"},{"name":"@sendgrid/mail","version":"^7.7.0"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"},{"name":"pg-boss","version":"^8.4.2"},{"name":"zod","version":"^3.23.8"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"^16.0.2"},{"name":"express","version":"~4.21.0"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"superjson","version":"^2.2.1"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"}]}}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/config.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/config.ts index 82b0f80b6a..fff77cb01c 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/config.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/config.ts @@ -1,6 +1,7 @@ import { stripTrailingSlash } from '../universal/url.js' +import { env } from './env.js' -const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; +const apiUrl = stripTrailingSlash(env.REACT_APP_API_URL) // PUBLIC API export type ClientConfig = { diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/env.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/env.ts new file mode 100644 index 0000000000..8ddab287f7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/env.ts @@ -0,0 +1,18 @@ +import * as z from 'zod' + +import { ensureEnvSchema } from '../env/validation.js' + +const userClientEnvSchema = z.object({}) + +const waspClientEnvSchema = z.object({ + REACT_APP_API_URL: z + .string({ + required_error: 'REACT_APP_API_URL is required', + }) + .default('http://localhost:3001') +}) + +const clientEnvSchema = userClientEnvSchema.merge(waspClientEnvSchema) + +// PUBLIC API +export const env = ensureEnvSchema(import.meta.env, clientEnvSchema) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/index.ts index cfce564c4d..859f8656b6 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/index.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/index.ts @@ -11,4 +11,7 @@ export enum HttpMethod { export type Route = { method: HttpMethod; path: string } // PUBLIC API -export { config, ClientConfig } from './config' +export { config, ClientConfig } from './config.js' + +// PUBLIC API +export { env } from './env.js' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/config.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/config.js index 1dffbd68bc..7e6149f386 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/config.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/config.js @@ -1,5 +1,6 @@ import { stripTrailingSlash } from '../universal/url.js'; -const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; +import { env } from './env.js'; +const apiUrl = stripTrailingSlash(env.REACT_APP_API_URL); // PUBLIC API export const config = { apiUrl, diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/config.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/config.js.map index d26d37022b..f9e186b838 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/config.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAExD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;AAOxD,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/env.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/env.d.ts new file mode 100644 index 0000000000..5a9417a810 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/env.d.ts @@ -0,0 +1,3 @@ +export declare const env: { + REACT_APP_API_URL: string; +}; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/env.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/env.js new file mode 100644 index 0000000000..91164c3768 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/env.js @@ -0,0 +1,14 @@ +import * as z from 'zod'; +import { ensureEnvSchema } from '../env/validation.js'; +const userClientEnvSchema = z.object({}); +const waspClientEnvSchema = z.object({ + REACT_APP_API_URL: z + .string({ + required_error: 'REACT_APP_API_URL is required', + }) + .default('http://localhost:3001') +}); +const clientEnvSchema = userClientEnvSchema.merge(waspClientEnvSchema); +// PUBLIC API +export const env = ensureEnvSchema(import.meta.env, clientEnvSchema); +//# sourceMappingURL=env.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/env.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/env.js.map new file mode 100644 index 0000000000..d230f15c0d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/env.js.map @@ -0,0 +1 @@ +{"version":3,"file":"env.js","sourceRoot":"","sources":["../../client/env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,iBAAiB,EAAE,CAAC;SACjB,MAAM,CAAC;QACN,cAAc,EAAE,+BAA+B;KAChD,CAAC;SACD,OAAO,CAAC,uBAAuB,CAAC;CACpC,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,mBAAmB,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;AAEtE,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.d.ts index 7f5f4bfbc8..6498c439bd 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.d.ts @@ -8,4 +8,5 @@ export type Route = { method: HttpMethod; path: string; }; -export { config, ClientConfig } from './config'; +export { config, ClientConfig } from './config.js'; +export { env } from './env.js'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js index 5a7f13dcae..2f4daa7ae3 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js @@ -8,5 +8,7 @@ export var HttpMethod; HttpMethod["Delete"] = "DELETE"; })(HttpMethod || (HttpMethod = {})); // PUBLIC API -export { config } from './config'; +export { config } from './config.js'; +// PUBLIC API +export { env } from './env.js'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js.map index 879953c8df..f3611558dc 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,MAAM,EAAgB,MAAM,UAAU,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,MAAM,EAAgB,MAAM,aAAa,CAAA;AAElD,aAAa;AACb,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/index.d.ts new file mode 100644 index 0000000000..d1dafc25fd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/index.d.ts @@ -0,0 +1,3 @@ +import * as z from 'zod'; +export declare function defineEnvValidationSchema>(schema: Schema): Schema; +export { ensureEnvSchema } from './validation.js'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/index.js new file mode 100644 index 0000000000..17e695d087 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/index.js @@ -0,0 +1,7 @@ +// PUBLIC API +export function defineEnvValidationSchema(schema) { + return schema; +} +// PRIVATE API (SDK, Vite config) +export { ensureEnvSchema } from './validation.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/index.js.map new file mode 100644 index 0000000000..75b4ff7de3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../env/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,MAAM,UAAU,yBAAyB,CACvC,MAAc;IAEd,OAAO,MAAM,CAAA;AACf,CAAC;AAED,iCAAiC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/validation.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/validation.d.ts new file mode 100644 index 0000000000..6bc9d059a3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/validation.d.ts @@ -0,0 +1,2 @@ +import * as z from 'zod'; +export declare function ensureEnvSchema(data: unknown, schema: Schema): z.infer; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/validation.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/validation.js new file mode 100644 index 0000000000..8463eb578e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/validation.js @@ -0,0 +1,23 @@ +import * as z from 'zod'; +const redColor = '\x1b[31m'; +export function ensureEnvSchema(data, schema) { + try { + return schema.parse(data); + } + catch (e) { + if (e instanceof z.ZodError) { + const errorOutput = ['', '══ Env vars validation failed ══', '']; + for (const error of e.errors) { + errorOutput.push(` - ${error.message}`); + } + errorOutput.push(''); + errorOutput.push('════════════════════════════════'); + console.error(redColor, errorOutput.join('\n')); + throw new Error('Error parsing environment variables'); + } + else { + throw e; + } + } +} +//# sourceMappingURL=validation.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/validation.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/validation.js.map new file mode 100644 index 0000000000..1d57b14a0b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/env/validation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../env/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,MAAM,QAAQ,GAAG,UAAU,CAAA;AAE3B,MAAM,UAAU,eAAe,CAC7B,IAAa,EACb,MAAc;IAEd,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;YAC5B,MAAM,WAAW,GAAG,CAAC,EAAE,EAAE,kCAAkC,EAAE,EAAE,CAAC,CAAA;YAChE,KAAK,MAAM,KAAK,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;gBAC7B,WAAW,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;YACzC,CAAC;YACD,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACpB,WAAW,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAA;YACpD,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;YAC/C,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;QACxD,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,CAAA;QACT,CAAC;IACH,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js.map index 8163354e1b..462e1c1811 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js.map @@ -1 +1 @@ -{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,OAAsB;QACvG,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YACE,UAAkB,EAClB,OAAgB,EAChB,IAA8B,EAC9B,OAAsB;QAEtB,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IACE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EACxE,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/env.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/env.d.ts deleted file mode 100644 index 08d2627b88..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function ensureEnvVarsForProvider(envVarNames: EnvVarName[], providerName: string): Record; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/env.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/env.js deleted file mode 100644 index 56281b5e36..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/env.js +++ /dev/null @@ -1,13 +0,0 @@ -// PRIVATE API (SDK) -export function ensureEnvVarsForProvider(envVarNames, providerName) { - const result = {}; - for (const envVarName of envVarNames) { - const value = process.env[envVarName]; - if (!value) { - throw new Error(`${envVarName} env variable is required when using the ${providerName} auth provider.`); - } - result[envVarName] = value; - } - return result; -} -//# sourceMappingURL=env.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/env.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/env.js.map deleted file mode 100644 index b25f2f9870..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/env.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"env.js","sourceRoot":"","sources":["../../../../server/auth/oauth/env.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,MAAM,UAAU,wBAAwB,CACtC,WAAyB,EACzB,YAAoB;IAEpB,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACtC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,4CAA4C,YAAY,iBAAiB,CAAC,CAAC;QAC1G,CAAC;QACD,MAAM,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC;IAC7B,CAAC;IACD,OAAO,MAAoC,CAAC;AAC9C,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/provider.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/provider.d.ts index 44d23b4952..8738b530a5 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,12 +1,10 @@ import { OAuth2Provider, OAuth2ProviderWithPKCE } from "arctic"; -export declare function defineProvider>({ id, displayName, env, oAuthClient, }: { +export declare function defineProvider({ id, displayName, oAuthClient, }: { id: string; displayName: string; - env: Env; oAuthClient: OAuthClient; }): { id: string; displayName: string; - env: Env; oAuthClient: OAuthClient; }; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/provider.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/provider.js index bc0d9a2fd8..eb6692b29c 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/provider.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/provider.js @@ -1,8 +1,7 @@ -export function defineProvider({ id, displayName, env, oAuthClient, }) { +export function defineProvider({ id, displayName, oAuthClient, }) { return { id, displayName, - env, 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 02fe380099..cf0b0f6459 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,CAG5B,EACA,EAAE,EACF,WAAW,EACX,GAAG,EACH,WAAW,GAMZ;IACC,OAAO;QACL,EAAE;QACF,WAAW;QACX,GAAG;QACH,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,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 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 7910449649..bf13237ad7 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,7 +1,6 @@ -import { Google } from "arctic"; +import { Google } from 'arctic'; export declare const google: { id: string; displayName: string; - env: Record<"GOOGLE_CLIENT_ID" | "GOOGLE_CLIENT_SECRET", string>; oAuthClient: Google; }; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/providers/google.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/providers/google.js index 7a49678dec..43ddbe1c75 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/providers/google.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/providers/google.js @@ -1,16 +1,14 @@ -import { Google } from "arctic"; -import { ensureEnvVarsForProvider } from "../env.js"; -import { getRedirectUriForCallback } from "../redirect.js"; -import { defineProvider } from "../provider.js"; -const id = "google"; -const displayName = "Google"; -const env = ensureEnvVarsForProvider(["GOOGLE_CLIENT_ID", "GOOGLE_CLIENT_SECRET"], displayName); +import { Google } from 'arctic'; +import { getRedirectUriForCallback } from '../redirect.js'; +import { defineProvider } from '../provider.js'; +import { env } from '../../../env.js'; +const id = 'google'; +const displayName = 'Google'; const oAuthClient = new Google(env.GOOGLE_CLIENT_ID, env.GOOGLE_CLIENT_SECRET, getRedirectUriForCallback(id).toString()); // PUBLIC API export const google = defineProvider({ id, displayName, - env, oAuthClient, }); //# sourceMappingURL=google.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/providers/google.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/providers/google.js.map index 1bebbd38aa..cf4d45a1aa 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/providers/google.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/providers/google.js.map @@ -1 +1 @@ -{"version":3,"file":"google.js","sourceRoot":"","sources":["../../../../../server/auth/oauth/providers/google.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAG,MAAM,QAAQ,CAAC;AAEjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,EAAE,GAAG,QAAQ,CAAC;AACpB,MAAM,WAAW,GAAG,QAAQ,CAAC;AAE7B,MAAM,GAAG,GAAG,wBAAwB,CAClC,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,EAC5C,WAAW,CACZ,CAAC;AAEF,MAAM,WAAW,GAAG,IAAI,MAAM,CAC5B,GAAG,CAAC,gBAAgB,EACpB,GAAG,CAAC,oBAAoB,EACxB,yBAAyB,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CACzC,CAAC;AAEF,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG,cAAc,CAAC;IACnC,EAAE;IACF,WAAW;IACX,GAAG;IACH,WAAW;CACZ,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"google.js","sourceRoot":"","sources":["../../../../../server/auth/oauth/providers/google.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAG,MAAM,QAAQ,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,MAAM,EAAE,GAAG,QAAQ,CAAC;AACpB,MAAM,WAAW,GAAG,QAAQ,CAAC;AAE7B,MAAM,WAAW,GAAG,IAAI,MAAM,CAC5B,GAAG,CAAC,gBAAgB,EACpB,GAAG,CAAC,oBAAoB,EACxB,yBAAyB,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CACzC,CAAC;AAEF,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAG,cAAc,CAAC;IACnC,EAAE;IACF,WAAW;IACX,WAAW;CACZ,CAAC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.d.ts index 56da48e819..a612dded65 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.d.ts @@ -1,19 +1,16 @@ -type BaseConfig = { - allowedCORSOrigins: string | string[]; - auth: { - jwtSecret: string | undefined; - }; -}; -type CommonConfig = BaseConfig & { - env: string; +import { env } from './env.js'; +type NodeEnv = typeof env.NODE_ENV; +type Config = { + env: NodeEnv; isDevelopment: boolean; port: number; - databaseUrl: string | undefined; -}; -type EnvConfig = BaseConfig & { + databaseUrl: string; frontendUrl: string; serverUrl: string; + allowedCORSOrigins: string | string[]; + auth: { + jwtSecret: string; + }; }; -type Config = CommonConfig & EnvConfig; -declare const resolvedConfig: Config; -export default resolvedConfig; +declare const config: Config; +export default config; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js index cb99fb1dd0..b5096b3b07 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js @@ -1,52 +1,24 @@ -var _a; -import merge from 'lodash.merge'; -import { stripTrailingSlash } from "../universal/url.js"; -const nodeEnv = (_a = process.env.NODE_ENV) !== null && _a !== void 0 ? _a : 'development'; +import { env } from './env.js'; +import { stripTrailingSlash } from '../universal/url.js'; +const frontendUrl = stripTrailingSlash(env.WASP_WEB_CLIENT_URL); +const serverUrl = stripTrailingSlash(env.WASP_SERVER_URL); +const allowedCORSOriginsPerEnv = { + development: '*', + production: [frontendUrl] +}; +const allowedCORSOrigins = allowedCORSOriginsPerEnv[env.NODE_ENV]; const config = { - all: { - env: nodeEnv, - isDevelopment: nodeEnv === 'development', - port: process.env.PORT ? parseInt(process.env.PORT) : 3001, - databaseUrl: process.env.DATABASE_URL, - allowedCORSOrigins: [], - auth: { - jwtSecret: undefined - } - }, - development: getDevelopmentConfig(), - production: getProductionConfig(), + frontendUrl, + serverUrl, + allowedCORSOrigins, + env: env.NODE_ENV, + isDevelopment: env.NODE_ENV === 'development', + port: env.PORT, + databaseUrl: env.DATABASE_URL, + auth: { + jwtSecret: env.JWT_SECRET + } }; -const resolvedConfig = merge(config.all, config[nodeEnv]); // PUBLIC API -export default resolvedConfig; -function getDevelopmentConfig() { - var _a, _b; - const frontendUrl = stripTrailingSlash((_a = process.env.WASP_WEB_CLIENT_URL) !== null && _a !== void 0 ? _a : 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash((_b = process.env.WASP_SERVER_URL) !== null && _b !== void 0 ? _b : 'http://localhost:3001'); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - allowedCORSOrigins: '*', - auth: { - jwtSecret: 'DEVJWTSECRET' - } - }; -} -function getProductionConfig() { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - // @ts-ignore - allowedCORSOrigins: [frontendUrl], - auth: { - jwtSecret: process.env.JWT_SECRET - } - }; -} +export default config; //# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js.map index 0ef81fb2bc..d83a878589 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,mCAAI,aAAa,CAAA;AA4BrD,MAAM,MAAM,GAIR;IACF,GAAG,EAAE;QACH,GAAG,EAAE,OAAO;QACZ,aAAa,EAAE,OAAO,KAAK,aAAa;QACxC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;QAC1D,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;QACtB,IAAI,EAAE;YACJ,SAAS,EAAE,SAAS;SACrB;KACF;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;CAClC,CAAA;AAED,MAAM,cAAc,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACjE,aAAa;AACb,eAAe,cAAc,CAAA;AAE7B,SAAS,oBAAoB;;IAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,mBAAmB,mCAAI,wBAAwB,CAAC,CAAC;IACpG,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,eAAe,mCAAI,uBAAuB,CAAC,CAAC;IAC7F,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,kBAAkB,EAAE,GAAG;QACvB,IAAI,EAAE;YACJ,SAAS,EAAE,cAAc;SAC1B;KACF,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAClE,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,aAAa;QACb,kBAAkB,EAAE,CAAC,WAAW,CAAC;QACjC,IAAI,EAAE;YACJ,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;SAClC;KACF,CAAA;AACH,CAAC"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAiBxD,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;AAC/D,MAAM,SAAS,GAAG,kBAAkB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;AAEzD,MAAM,wBAAwB,GAAuC;IACnE,WAAW,EAAE,GAAG;IAChB,UAAU,EAAE,CAAC,WAAW,CAAC;CAC1B,CAAA;AACD,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAEjE,MAAM,MAAM,GAAW;IACrB,WAAW;IACX,SAAS;IACT,kBAAkB;IAClB,GAAG,EAAE,GAAG,CAAC,QAAQ;IACjB,aAAa,EAAE,GAAG,CAAC,QAAQ,KAAK,aAAa;IAC7C,IAAI,EAAE,GAAG,CAAC,IAAI;IACd,WAAW,EAAE,GAAG,CAAC,YAAY;IAC7B,IAAI,EAAE;QACJ,SAAS,EAAE,GAAG,CAAC,UAAU;KAC1B;CACF,CAAA;AAED,aAAa;AACb,eAAe,MAAM,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js index 91c1207b30..c32555c034 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js @@ -1,9 +1,8 @@ +import { env } from '../env.js'; import { initEmailSender } from "./core/index.js"; -// TODO: We need to validate all the env variables -// For now, we are letting the runtime throw if they are not provided const emailProvider = { type: "sendgrid", - apiKey: process.env.SENDGRID_API_KEY, + apiKey: env.SENDGRID_API_KEY, }; // PUBLIC API export const emailSender = initEmailSender(emailProvider); diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js.map index 1629cdd0f0..18787c5c87 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/email/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,kDAAkD;AAClD,qEAAqE;AACrE,MAAM,aAAa,GAAG;IACpB,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAiB;CAC7B,CAAC;AAEX,aAAa;AACb,MAAM,CAAC,MAAM,WAAW,GAAgB,eAAe,CAAC,aAAa,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/email/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,MAAM,aAAa,GAAG;IACpB,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,GAAG,CAAC,gBAAgB;CACpB,CAAC;AAEX,aAAa;AACb,MAAM,CAAC,MAAM,WAAW,GAAgB,eAAe,CAAC,aAAa,CAAC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/env.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/env.d.ts new file mode 100644 index 0000000000..72587aed6b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/env.d.ts @@ -0,0 +1,25 @@ +export declare const env: { + PORT: number; + DATABASE_URL: string; + SENDGRID_API_KEY: string; + SKIP_EMAIL_VERIFICATION_IN_DEV: boolean; + GOOGLE_CLIENT_ID: string; + GOOGLE_CLIENT_SECRET: string; + NODE_ENV: "development"; + WASP_SERVER_URL: string; + WASP_WEB_CLIENT_URL: string; + JWT_SECRET: string; + PG_BOSS_NEW_OPTIONS?: string | undefined; +} | { + PORT: number; + DATABASE_URL: string; + SENDGRID_API_KEY: string; + SKIP_EMAIL_VERIFICATION_IN_DEV: boolean; + GOOGLE_CLIENT_ID: string; + GOOGLE_CLIENT_SECRET: string; + NODE_ENV: "production"; + WASP_SERVER_URL: string; + WASP_WEB_CLIENT_URL: string; + JWT_SECRET: string; + PG_BOSS_NEW_OPTIONS?: string | undefined; +}; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/env.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/env.js new file mode 100644 index 0000000000..42249b691c --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/env.js @@ -0,0 +1,71 @@ +import * as z from 'zod'; +import { ensureEnvSchema } from '../env/validation.js'; +const userServerEnvSchema = z.object({}); +const waspServerCommonSchema = z.object({ + PORT: z.coerce.number().default(3001), + DATABASE_URL: z.string({ + required_error: 'DATABASE_URL is required', + }), + PG_BOSS_NEW_OPTIONS: z.string().optional(), + SENDGRID_API_KEY: z.string({ + required_error: getRequiredEnvVarErrorMessage('SendGrid email sender', 'SENDGRID_API_KEY'), + }), + SKIP_EMAIL_VERIFICATION_IN_DEV: z + .enum(['true', 'false'], { + message: 'SKIP_EMAIL_VERIFICATION_IN_DEV must be either "true" or "false"', + }) + .transform((value) => value === 'true') + .default('false'), + GOOGLE_CLIENT_ID: z.string({ + required_error: getRequiredEnvVarErrorMessage('Google auth provider', 'GOOGLE_CLIENT_ID'), + }), + GOOGLE_CLIENT_SECRET: z.string({ + required_error: getRequiredEnvVarErrorMessage('Google auth provider', 'GOOGLE_CLIENT_SECRET'), + }), +}); +const serverUrlSchema = z + .string({ + required_error: 'WASP_SERVER_URL is required', +}) + .url({ + message: 'WASP_SERVER_URL must be a valid URL', +}); +const clientUrlSchema = z + .string({ + required_error: 'WASP_WEB_CLIENT_URL is required', +}) + .url({ + message: 'WASP_WEB_CLIENT_URL must be a valid URL', +}); +const jwtTokenSchema = z + .string({ + required_error: 'JWT_SECRET is required', +}); +// In development, we provide default values for some environment variables +// to make the development process easier. +const serverDevSchema = z.object({ + NODE_ENV: z.literal('development'), + WASP_SERVER_URL: serverUrlSchema + .default('http://localhost:3001'), + WASP_WEB_CLIENT_URL: clientUrlSchema + .default('http://localhost:3000/'), + JWT_SECRET: jwtTokenSchema + .default('DEVJWTSECRET'), +}); +const serverProdSchema = z.object({ + NODE_ENV: z.literal('production'), + WASP_SERVER_URL: serverUrlSchema, + WASP_WEB_CLIENT_URL: clientUrlSchema, + JWT_SECRET: jwtTokenSchema, +}); +const serverCommonSchema = userServerEnvSchema.merge(waspServerCommonSchema); +const serverEnvSchema = z.discriminatedUnion('NODE_ENV', [ + serverDevSchema.merge(serverCommonSchema), + serverProdSchema.merge(serverCommonSchema) +]); +// PUBLIC API +export const env = ensureEnvSchema(process.env, serverEnvSchema); +function getRequiredEnvVarErrorMessage(featureName, envVarName) { + return `${envVarName} is required when using ${featureName}`; +} +//# sourceMappingURL=env.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/env.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/env.js.map new file mode 100644 index 0000000000..7560809692 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/env.js.map @@ -0,0 +1 @@ +{"version":3,"file":"env.js","sourceRoot":"","sources":["../../server/env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACrC,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC;QACrB,cAAc,EAAE,0BAA0B;KAC3C,CAAC;IACF,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,gBAAgB,EAAE,CAAC,CAAC,MAAM,CAAC;QACzB,cAAc,EAAE,6BAA6B,CAAC,uBAAuB,EAAE,kBAAkB,CAAC;KAC3F,CAAC;IACF,8BAA8B,EAAE,CAAC;SAC9B,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACvB,OAAO,EAAE,iEAAiE;KAC3E,CAAC;SACD,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,MAAM,CAAC;SACtC,OAAO,CAAC,OAAO,CAAC;IACnB,gBAAgB,EAAE,CAAC,CAAC,MAAM,CAAC;QACzB,cAAc,EAAE,6BAA6B,CAAC,sBAAsB,EAAE,kBAAkB,CAAC;KAC1F,CAAC;IACF,oBAAoB,EAAE,CAAC,CAAC,MAAM,CAAC;QAC7B,cAAc,EAAE,6BAA6B,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;KAC9F,CAAC;CACH,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,CAAC;KACtB,MAAM,CAAC;IACN,cAAc,EAAE,6BAA6B;CAC9C,CAAC;KACD,GAAG,CAAC;IACH,OAAO,EAAE,qCAAqC;CAC/C,CAAC,CAAA;AAEJ,MAAM,eAAe,GAAG,CAAC;KACtB,MAAM,CAAC;IACN,cAAc,EAAE,iCAAiC;CAClD,CAAC;KACD,GAAG,CAAC;IACH,OAAO,EAAE,yCAAyC;CACnD,CAAC,CAAA;AAEJ,MAAM,cAAc,GAAG,CAAC;KACrB,MAAM,CAAC;IACN,cAAc,EAAE,wBAAwB;CACzC,CAAC,CAAA;AAEJ,2EAA2E;AAC3E,0CAA0C;AAC1C,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAClC,eAAe,EAAE,eAAe;SAC7B,OAAO,CAAC,uBAAuB,CAAC;IACnC,mBAAmB,EAAE,eAAe;SACjC,OAAO,CAAC,wBAAwB,CAAC;IACpC,UAAU,EAAE,cAAc;SACvB,OAAO,CAAC,cAAc,CAAC;CAC3B,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IACjC,eAAe,EAAE,eAAe;IAChC,mBAAmB,EAAE,eAAe;IACpC,UAAU,EAAE,cAAc;CAC3B,CAAC,CAAA;AAEF,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;AAC5E,MAAM,eAAe,GAAG,CAAC,CAAC,kBAAkB,CAAC,UAAU,EAAE;IACvD,eAAe,CAAC,KAAK,CAAC,kBAAkB,CAAC;IACzC,gBAAgB,CAAC,KAAK,CAAC,kBAAkB,CAAC;CAC3C,CAAC,CAAA;AAEF,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,eAAe,CAAC,CAAA;AAEhE,SAAS,6BAA6B,CAAC,WAAmB,EAAE,UAAkB;IAC5E,OAAO,GAAG,UAAU,2BAA2B,WAAW,EAAE,CAAA;AAC9D,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.d.ts index dee9613a53..a108f6123f 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.d.ts @@ -4,4 +4,5 @@ export { default as prisma } from './dbClient.js'; export { type ServerSetupFn } from './types/index.js'; export { HttpError } from './HttpError.js'; export { MiddlewareConfigFn } from './middleware/index.js'; +export { env } from './env.js'; export type DbSeedFn = (prisma: PrismaClient) => Promise; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js index 0e53e0deab..8e75e6f78c 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js @@ -4,4 +4,6 @@ export { default as config } from './config.js'; export { default as prisma } from './dbClient.js'; // PUBLIC API export { HttpError } from './HttpError.js'; +// PUBLIC API +export { env } from './env.js'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js.map index b84ac1b303..87ed22f3af 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAA;AAC/C,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,eAAe,CAAA;AAGjD,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAA;AAC/C,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,eAAe,CAAA;AAGjD,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAG1C,aAAa;AACb,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js index d1feb61aed..8fe6f220bc 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js @@ -1,14 +1,14 @@ import PgBoss from 'pg-boss'; -import { config } from 'wasp/server'; +import { config, env } from '../../../index.js'; const boss = createPgBoss(); function createPgBoss() { let pgBossNewOptions = { connectionString: config.databaseUrl, }; // Add an escape hatch for advanced configuration of pg-boss to overwrite our defaults. - if (process.env.PG_BOSS_NEW_OPTIONS) { + if (env.PG_BOSS_NEW_OPTIONS) { try { - pgBossNewOptions = JSON.parse(process.env.PG_BOSS_NEW_OPTIONS); + pgBossNewOptions = JSON.parse(env.PG_BOSS_NEW_OPTIONS); } catch (_a) { console.error('Environment variable PG_BOSS_NEW_OPTIONS was not parsable by JSON.parse()!'); diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map index ebe3e7b855..c87ccbfc48 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map @@ -1 +1 @@ -{"version":3,"file":"pgBoss.js","sourceRoot":"","sources":["../../../../../server/jobs/core/pgBoss/pgBoss.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,MAAM,IAAI,GAAG,YAAY,EAAE,CAAA;AAE3B,SAAS,YAAY;IACnB,IAAI,gBAAgB,GAAG;QACrB,gBAAgB,EAAE,MAAM,CAAC,WAAW;KACrC,CAAA;IAED,uFAAuF;IACvF,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,CAAC;QACpC,IAAI,CAAC;YACH,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;QAChE,CAAC;QAAC,WAAM,CAAC;YACP,OAAO,CAAC,KAAK,CACX,4EAA4E,CAC7E,CAAA;QACH,CAAC;IACH,CAAC;IAED,OAAO,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAA;AACrC,CAAC;AAED,IAAI,oBAA4C,CAAA;AAChD,IAAI,mBAA2C,CAAA;AAC/C,cAAc;AACd,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IACnE,oBAAoB,GAAG,OAAO,CAAA;IAC9B,mBAAmB,GAAG,MAAM,CAAA;AAC9B,CAAC,CAAC,CAAA;AAEF,IAAK,YAKJ;AALD,WAAK,YAAY;IACf,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;AACjB,CAAC,EALI,YAAY,KAAZ,YAAY,QAKhB;AAED,IAAI,YAAY,GAAiB,YAAY,CAAC,SAAS,CAAA;AAEvD,cAAc;AACd;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,sEAAsE;IACtE,IAAI,YAAY,KAAK,YAAY,CAAC,SAAS,EAAE,CAAC;QAC5C,OAAM;IACR,CAAC;IACD,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAA;IACpC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;IAElC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;IACjD,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAA;QACzC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACpB,YAAY,GAAG,YAAY,CAAC,KAAK,CAAA;QACjC,mBAAmB,CAAC,IAAI,CAAC,CAAA;QACzB,OAAM;IACR,CAAC;IAED,oBAAoB,CAAC,IAAI,CAAC,CAAA;IAE1B,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;IAC/B,YAAY,GAAG,YAAY,CAAC,OAAO,CAAA;AACrC,CAAC"} \ No newline at end of file +{"version":3,"file":"pgBoss.js","sourceRoot":"","sources":["../../../../../server/jobs/core/pgBoss/pgBoss.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAE/C,MAAM,IAAI,GAAG,YAAY,EAAE,CAAA;AAE3B,SAAS,YAAY;IACnB,IAAI,gBAAgB,GAAG;QACrB,gBAAgB,EAAE,MAAM,CAAC,WAAW;KACrC,CAAA;IAED,uFAAuF;IACvF,IAAI,GAAG,CAAC,mBAAmB,EAAE,CAAC;QAC5B,IAAI,CAAC;YACH,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;QACxD,CAAC;QAAC,WAAM,CAAC;YACP,OAAO,CAAC,KAAK,CACX,4EAA4E,CAC7E,CAAA;QACH,CAAC;IACH,CAAC;IAED,OAAO,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAA;AACrC,CAAC;AAED,IAAI,oBAA4C,CAAA;AAChD,IAAI,mBAA2C,CAAA;AAC/C,cAAc;AACd,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IACnE,oBAAoB,GAAG,OAAO,CAAA;IAC9B,mBAAmB,GAAG,MAAM,CAAA;AAC9B,CAAC,CAAC,CAAA;AAEF,IAAK,YAKJ;AALD,WAAK,YAAY;IACf,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;AACjB,CAAC,EALI,YAAY,KAAZ,YAAY,QAKhB;AAED,IAAI,YAAY,GAAiB,YAAY,CAAC,SAAS,CAAA;AAEvD,cAAc;AACd;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,sEAAsE;IACtE,IAAI,YAAY,KAAK,YAAY,CAAC,SAAS,EAAE,CAAC;QAC5C,OAAM;IACR,CAAC;IACD,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAA;IACpC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;IAElC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;IACjD,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAA;QACzC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACpB,YAAY,GAAG,YAAY,CAAC,KAAK,CAAA;QACjC,mBAAmB,CAAC,IAAI,CAAC,CAAA;QACzB,OAAM;IACR,CAAC;IAED,oBAAoB,CAAC,IAAI,CAAC,CAAA;IAE1B,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;IAC/B,YAAY,GAAG,YAAY,CAAC,OAAO,CAAA;AACrC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.d.ts index aa893e7838..7ceb994694 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.d.ts @@ -1 +1,2 @@ -export declare function stripTrailingSlash(url?: string): string | undefined; +export declare function stripTrailingSlash(url: string): string; +export declare function stripTrailingSlash(url: undefined): undefined; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.js.map index a7bad96020..e236f1b977 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/url.js.map @@ -1 +1 @@ -{"version":3,"file":"url.js","sourceRoot":"","sources":["../../universal/url.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC3C,OAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC"} \ No newline at end of file +{"version":3,"file":"url.js","sourceRoot":"","sources":["../../universal/url.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC3C,OAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/env/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/env/index.ts new file mode 100644 index 0000000000..4c783125c1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/env/index.ts @@ -0,0 +1,11 @@ +import * as z from 'zod' + +// PUBLIC API +export function defineEnvValidationSchema>( + schema: Schema, +): Schema { + return schema +} + +// PRIVATE API (SDK, Vite config) +export { ensureEnvSchema } from './validation.js' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/env/validation.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/env/validation.ts new file mode 100644 index 0000000000..a5bc334754 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/env/validation.ts @@ -0,0 +1,25 @@ +import * as z from 'zod' + +const redColor = '\x1b[31m' + +export function ensureEnvSchema( + data: unknown, + schema: Schema +): z.infer { + try { + return schema.parse(data) + } catch (e) { + if (e instanceof z.ZodError) { + const errorOutput = ['', '══ Env vars validation failed ══', ''] + for (const error of e.errors) { + errorOutput.push(` - ${error.message}`) + } + errorOutput.push('') + errorOutput.push('════════════════════════════════') + console.error(redColor, errorOutput.join('\n')) + throw new Error('Error parsing environment variables') + } else { + throw e + } + } +} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/package.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/package.json index 39b7641835..7fcae55c1d 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/package.json +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/package.json @@ -13,7 +13,6 @@ "axios": "^1.4.0", "express": "~4.21.0", "jsdom": "^21.1.1", - "lodash.merge": "^4.6.2", "lucia": "^3.0.1", "mitt": "3.0.0", "msw": "^1.1.0", @@ -24,7 +23,8 @@ "react-hook-form": "^7.45.4", "react-router-dom": "^6.26.2", "superjson": "^2.2.1", - "vitest": "^1.2.1" + "vitest": "^1.2.1", + "zod": "^3.23.8" }, "devDependencies": { "@tsconfig/node18": "latest", @@ -59,6 +59,7 @@ "./core/storage": "./dist/core/storage.js", "./dev": "./dist/dev/index.js", "./entities": "./dist/entities/index.js", + "./env": "./dist/env/index.js", "./ext-src/*": "./dist/ext-src/*.js", "./operations": "./dist/operations/index.js", "./operations/*": "./dist/operations/*", diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/HttpError.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/HttpError.ts index d05a2c841b..bce964712d 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/HttpError.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/HttpError.ts @@ -2,7 +2,12 @@ export class HttpError extends Error { public statusCode: number public data: unknown - constructor (statusCode: number, message?: string, data?: Record, options?: ErrorOptions) { + constructor( + statusCode: number, + message?: string, + data?: Record, + options?: ErrorOptions + ) { super(message, options) if (Error.captureStackTrace) { @@ -11,7 +16,9 @@ export class HttpError extends Error { this.name = this.constructor.name - if (!(Number.isInteger(statusCode) && statusCode >= 400 && statusCode < 600)) { + if ( + !(Number.isInteger(statusCode) && statusCode >= 400 && statusCode < 600) + ) { throw new Error('statusCode has to be integer in range [400, 600).') } this.statusCode = statusCode diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/env.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/env.ts deleted file mode 100644 index ada2452b8e..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/env.ts +++ /dev/null @@ -1,15 +0,0 @@ -// PRIVATE API (SDK) -export function ensureEnvVarsForProvider( - envVarNames: EnvVarName[], - providerName: string, -): Record { - const result: Record = {}; - for (const envVarName of envVarNames) { - const value = process.env[envVarName]; - if (!value) { - throw new Error(`${envVarName} env variable is required when using the ${providerName} auth provider.`); - } - result[envVarName] = value; - } - return result as Record; -} 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 c2aee70897..c02e5adbee 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,23 +1,19 @@ import { OAuth2Provider, OAuth2ProviderWithPKCE } from "arctic"; export function defineProvider< - OAuthClient extends OAuth2Provider | OAuth2ProviderWithPKCE, - Env extends Record + OAuthClient extends OAuth2Provider | OAuth2ProviderWithPKCE >({ id, displayName, - env, oAuthClient, }: { id: string; displayName: string; - env: Env; oAuthClient: OAuthClient; }) { return { id, displayName, - env, oAuthClient, }; } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/providers/google.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/providers/google.ts index 9f6aaf216c..792e16d308 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/providers/google.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/providers/google.ts @@ -1,16 +1,11 @@ -import { Google } from "arctic"; +import { Google } from 'arctic'; -import { ensureEnvVarsForProvider } from "../env.js"; -import { getRedirectUriForCallback } from "../redirect.js"; -import { defineProvider } from "../provider.js"; +import { getRedirectUriForCallback } from '../redirect.js'; +import { defineProvider } from '../provider.js'; +import { env } from '../../../env.js'; -const id = "google"; -const displayName = "Google"; - -const env = ensureEnvVarsForProvider( - ["GOOGLE_CLIENT_ID", "GOOGLE_CLIENT_SECRET"], - displayName, -); +const id = 'google'; +const displayName = 'Google'; const oAuthClient = new Google( env.GOOGLE_CLIENT_ID, @@ -22,6 +17,5 @@ const oAuthClient = new Google( export const google = defineProvider({ id, displayName, - env, oAuthClient, }); diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/config.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/config.ts index 4ca36bd30f..8106e5b84c 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/config.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/config.ts @@ -1,85 +1,42 @@ -import merge from 'lodash.merge' +import { env } from './env.js' +import { stripTrailingSlash } from '../universal/url.js' -import { stripTrailingSlash } from "../universal/url.js"; +type NodeEnv = typeof env.NODE_ENV -const nodeEnv = process.env.NODE_ENV ?? 'development' - -// TODO: -// - Use dotenv library to consume env vars from a file. -// - Use convict library to define schema and validate env vars. -// https://codingsans.com/blog/node-config-best-practices - -type BaseConfig = { - allowedCORSOrigins: string | string[]; - auth: { - jwtSecret: string | undefined; - } -} - -type CommonConfig = BaseConfig & { - env: string; +type Config = { + env: NodeEnv; isDevelopment: boolean; port: number; - databaseUrl: string | undefined; -} - -type EnvConfig = BaseConfig & { + databaseUrl: string; frontendUrl: string; serverUrl: string; + allowedCORSOrigins: string | string[]; + auth: { + jwtSecret: string; + } } -type Config = CommonConfig & EnvConfig +const frontendUrl = stripTrailingSlash(env.WASP_WEB_CLIENT_URL) +const serverUrl = stripTrailingSlash(env.WASP_SERVER_URL) -const config: { - all: CommonConfig, - development: EnvConfig, - production: EnvConfig, -} = { - all: { - env: nodeEnv, - isDevelopment: nodeEnv === 'development', - port: process.env.PORT ? parseInt(process.env.PORT) : 3001, - databaseUrl: process.env.DATABASE_URL, - allowedCORSOrigins: [], - auth: { - jwtSecret: undefined - } - }, - development: getDevelopmentConfig(), - production: getProductionConfig(), +const allowedCORSOriginsPerEnv: Record = { + development: '*', + production: [frontendUrl] } - -const resolvedConfig: Config = merge(config.all, config[nodeEnv]) -// PUBLIC API -export default resolvedConfig - -function getDevelopmentConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL ?? 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL ?? 'http://localhost:3001'); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - allowedCORSOrigins: '*', - auth: { - jwtSecret: 'DEVJWTSECRET' - } +const allowedCORSOrigins = allowedCORSOriginsPerEnv[env.NODE_ENV] + +const config: Config = { + frontendUrl, + serverUrl, + allowedCORSOrigins, + env: env.NODE_ENV, + isDevelopment: env.NODE_ENV === 'development', + port: env.PORT, + databaseUrl: env.DATABASE_URL, + auth: { + jwtSecret: env.JWT_SECRET } } -function getProductionConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - // @ts-ignore - allowedCORSOrigins: [frontendUrl], - auth: { - jwtSecret: process.env.JWT_SECRET - } - } -} +// PUBLIC API +export default config diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/index.ts index 3168a70671..217c640ea7 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/index.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/index.ts @@ -1,11 +1,10 @@ +import { env } from '../env.js'; import { initEmailSender } from "./core/index.js"; import { EmailSender } from "./core/types.js"; -// TODO: We need to validate all the env variables -// For now, we are letting the runtime throw if they are not provided const emailProvider = { type: "sendgrid", - apiKey: process.env.SENDGRID_API_KEY!, + apiKey: env.SENDGRID_API_KEY, } as const; // PUBLIC API diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/env.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/env.ts new file mode 100644 index 0000000000..d7c817e8ea --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/env.ts @@ -0,0 +1,81 @@ +import * as z from 'zod' + +import { ensureEnvSchema } from '../env/validation.js' + +const userServerEnvSchema = z.object({}) + +const waspServerCommonSchema = z.object({ + PORT: z.coerce.number().default(3001), + DATABASE_URL: z.string({ + required_error: 'DATABASE_URL is required', + }), + PG_BOSS_NEW_OPTIONS: z.string().optional(), + SENDGRID_API_KEY: z.string({ + required_error: getRequiredEnvVarErrorMessage('SendGrid email sender', 'SENDGRID_API_KEY'), + }), + SKIP_EMAIL_VERIFICATION_IN_DEV: z + .enum(['true', 'false'], { + message: 'SKIP_EMAIL_VERIFICATION_IN_DEV must be either "true" or "false"', + }) + .transform((value) => value === 'true') + .default('false'), + GOOGLE_CLIENT_ID: z.string({ + required_error: getRequiredEnvVarErrorMessage('Google auth provider', 'GOOGLE_CLIENT_ID'), + }), + GOOGLE_CLIENT_SECRET: z.string({ + required_error: getRequiredEnvVarErrorMessage('Google auth provider', 'GOOGLE_CLIENT_SECRET'), + }), +}) + +const serverUrlSchema = z + .string({ + required_error: 'WASP_SERVER_URL is required', + }) + .url({ + message: 'WASP_SERVER_URL must be a valid URL', + }) + +const clientUrlSchema = z + .string({ + required_error: 'WASP_WEB_CLIENT_URL is required', + }) + .url({ + message: 'WASP_WEB_CLIENT_URL must be a valid URL', + }) + +const jwtTokenSchema = z + .string({ + required_error: 'JWT_SECRET is required', + }) + +// In development, we provide default values for some environment variables +// to make the development process easier. +const serverDevSchema = z.object({ + NODE_ENV: z.literal('development'), + WASP_SERVER_URL: serverUrlSchema + .default('http://localhost:3001'), + WASP_WEB_CLIENT_URL: clientUrlSchema + .default('http://localhost:3000/'), + JWT_SECRET: jwtTokenSchema + .default('DEVJWTSECRET'), +}) + +const serverProdSchema = z.object({ + NODE_ENV: z.literal('production'), + WASP_SERVER_URL: serverUrlSchema, + WASP_WEB_CLIENT_URL: clientUrlSchema, + JWT_SECRET: jwtTokenSchema, +}) + +const serverCommonSchema = userServerEnvSchema.merge(waspServerCommonSchema) +const serverEnvSchema = z.discriminatedUnion('NODE_ENV', [ + serverDevSchema.merge(serverCommonSchema), + serverProdSchema.merge(serverCommonSchema) +]) + +// PUBLIC API +export const env = ensureEnvSchema(process.env, serverEnvSchema) + +function getRequiredEnvVarErrorMessage(featureName: string, envVarName: string) { + return `${envVarName} is required when using ${featureName}` +} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/index.ts index 535077900b..0f95deb90a 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/index.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/index.ts @@ -10,6 +10,8 @@ export { type ServerSetupFn } from './types/index.js' export { HttpError } from './HttpError.js' // PUBLIC API export { MiddlewareConfigFn } from './middleware/index.js' +// PUBLIC API +export { env } from './env.js' // PUBLIC API export type DbSeedFn = (prisma: PrismaClient) => Promise diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts index a48992aad0..eed0cf23cc 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts @@ -1,5 +1,5 @@ import PgBoss from 'pg-boss' -import { config } from 'wasp/server' +import { config, env } from '../../../index.js' const boss = createPgBoss() @@ -9,9 +9,9 @@ function createPgBoss() { } // Add an escape hatch for advanced configuration of pg-boss to overwrite our defaults. - if (process.env.PG_BOSS_NEW_OPTIONS) { + if (env.PG_BOSS_NEW_OPTIONS) { try { - pgBossNewOptions = JSON.parse(process.env.PG_BOSS_NEW_OPTIONS) + pgBossNewOptions = JSON.parse(env.PG_BOSS_NEW_OPTIONS) } catch { console.error( 'Environment variable PG_BOSS_NEW_OPTIONS was not parsable by JSON.parse()!' diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/url.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/url.ts index d21c06c65c..126678dac9 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/url.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/url.ts @@ -1,3 +1,5 @@ +export function stripTrailingSlash(url: string): string +export function stripTrailingSlash(url: undefined): undefined export function stripTrailingSlash(url?: string): string | undefined { return url?.replace(/\/$/, ""); } 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 413d85a86f..e3d0d954da 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 @@ -34,9 +34,8 @@ "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", - "start": "npm run validate-env && node --enable-source-maps -r dotenv/config bundle/server.js", + "start": "node --enable-source-maps -r dotenv/config bundle/server.js", "start-production": "npm run db-migrate-prod && NODE_ENV=production npm run start", - "validate-env": "node -r dotenv/config ./scripts/validate-env.mjs", "watch": "nodemon --exec 'npm run bundle-and-start || exit 1'" }, "type": "module", diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/scripts/validate-env.mjs deleted file mode 100644 index f6e50aceca..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/scripts/validate-env.mjs +++ /dev/null @@ -1,5 +0,0 @@ -import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; - -console.info("🔍 Validating environment variables..."); -throwIfNotValidAbsoluteURL(process.env.WASP_WEB_CLIENT_URL, 'Environment variable WASP_WEB_CLIENT_URL'); -throwIfNotValidAbsoluteURL(process.env.WASP_SERVER_URL, 'Environment variable WASP_SERVER_URL'); diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/cookies.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/cookies.ts index 10fdd63984..b398c2e40d 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/cookies.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/cookies.ts @@ -1,10 +1,11 @@ import { Request as ExpressRequest, Response as ExpressResponse, -} from "express"; -import { parseCookies } from "oslo/cookie"; +} from 'express'; +import { parseCookies } from 'oslo/cookie'; -import type { ProviderConfig } from "wasp/auth/providers/types"; +import type { ProviderConfig } from 'wasp/auth/providers/types'; +import { config } from 'wasp/server'; import type { OAuthStateFieldName } from './state'; @@ -17,8 +18,7 @@ export function setOAuthCookieValue( const cookieName = `${provider.id}_${fieldName}`; res.cookie(cookieName, value, { httpOnly: true, - // TODO: use server config to determine if secure - secure: process.env.NODE_ENV === "production", + secure: !config.isDevelopment, path: "/", maxAge: 60 * 60 * 1000, // 1 hour }); diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/polyfill.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/polyfill.ts index 7931d12eb0..9279daf6da 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/polyfill.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/polyfill.ts @@ -1,11 +1,10 @@ // This is a polyfill for Node.js 18 webcrypto API so Lucia can use it // for random number generation. -import { webcrypto } from "node:crypto"; +import { webcrypto } from 'node:crypto' // NOTE: node < 19 doesn't have Crypto API, which we need for Lucia, so we apply the polyfill if Crypto API is not defined. -if (typeof globalThis.crypto === "undefined") { +if (typeof globalThis.crypto === 'undefined') { // @ts-ignore - globalThis.crypto = webcrypto as Crypto; + globalThis.crypto = webcrypto as Crypto } - diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/package.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/package.json index 92845d4306..bb1aa1d8a0 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/package.json +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/package.json @@ -18,8 +18,7 @@ "devDependencies": { "@tsconfig/vite-react": "^2.0.0", "@types/react-dom": "^18.0.11", - "@vitejs/plugin-react": "^4.2.1", - "dotenv": "^16.0.3" + "@vitejs/plugin-react": "^4.2.1" }, "engineStrict": true, "engines": { @@ -28,9 +27,8 @@ "name": "waspComplexTest", "private": true, "scripts": { - "build": "npm run validate-env && tsc && vite build", - "start": "npm run validate-env && vite", - "validate-env": "node -r dotenv/config ./scripts/validate-env.mjs" + "build": "tsc && vite build", + "start": "vite" }, "type": "module", "version": "0.0.0" diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/scripts/validate-env.mjs deleted file mode 100644 index 18ee507c9e..0000000000 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/scripts/validate-env.mjs +++ /dev/null @@ -1,4 +0,0 @@ -import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; - -console.info("🔍 Validating environment variables..."); -throwIfNotValidAbsoluteURL(process.env.REACT_APP_API_URL, 'Environemnt variable REACT_APP_API_URL'); diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx index 7af24e15d6..1e931935e6 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx @@ -7,7 +7,10 @@ export function DefaultRootErrorBoundary() { console.error(error) return ( -
There was an error rendering this page. Check the browser console for more information.
+
+ There was an error rendering this page. Check the browser console for + more information. +
) } diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest b/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest index c04620f749..544607942f 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest @@ -7,6 +7,7 @@ waspJob/.wasp/out/installedNpmDepsLog.json waspJob/.wasp/out/sdk/wasp/api/events.ts waspJob/.wasp/out/sdk/wasp/api/index.ts waspJob/.wasp/out/sdk/wasp/client/config.ts +waspJob/.wasp/out/sdk/wasp/client/env.ts waspJob/.wasp/out/sdk/wasp/client/index.ts waspJob/.wasp/out/sdk/wasp/client/operations/actions/core.ts waspJob/.wasp/out/sdk/wasp/client/operations/actions/index.ts @@ -36,6 +37,9 @@ waspJob/.wasp/out/sdk/wasp/dist/api/index.js.map waspJob/.wasp/out/sdk/wasp/dist/client/config.d.ts waspJob/.wasp/out/sdk/wasp/dist/client/config.js waspJob/.wasp/out/sdk/wasp/dist/client/config.js.map +waspJob/.wasp/out/sdk/wasp/dist/client/env.d.ts +waspJob/.wasp/out/sdk/wasp/dist/client/env.js +waspJob/.wasp/out/sdk/wasp/dist/client/env.js.map waspJob/.wasp/out/sdk/wasp/dist/client/index.d.ts waspJob/.wasp/out/sdk/wasp/dist/client/index.js waspJob/.wasp/out/sdk/wasp/dist/client/index.js.map @@ -99,6 +103,12 @@ waspJob/.wasp/out/sdk/wasp/dist/dev/index.js.map waspJob/.wasp/out/sdk/wasp/dist/entities/index.d.ts waspJob/.wasp/out/sdk/wasp/dist/entities/index.js waspJob/.wasp/out/sdk/wasp/dist/entities/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/env/index.d.ts +waspJob/.wasp/out/sdk/wasp/dist/env/index.js +waspJob/.wasp/out/sdk/wasp/dist/env/index.js.map +waspJob/.wasp/out/sdk/wasp/dist/env/validation.d.ts +waspJob/.wasp/out/sdk/wasp/dist/env/validation.js +waspJob/.wasp/out/sdk/wasp/dist/env/validation.js.map waspJob/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts waspJob/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx waspJob/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map @@ -123,6 +133,9 @@ waspJob/.wasp/out/sdk/wasp/dist/server/config.js.map waspJob/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts waspJob/.wasp/out/sdk/wasp/dist/server/dbClient.js waspJob/.wasp/out/sdk/wasp/dist/server/dbClient.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/env.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/env.js +waspJob/.wasp/out/sdk/wasp/dist/server/env.js.map waspJob/.wasp/out/sdk/wasp/dist/server/index.d.ts waspJob/.wasp/out/sdk/wasp/dist/server/index.js waspJob/.wasp/out/sdk/wasp/dist/server/index.js.map @@ -196,6 +209,8 @@ waspJob/.wasp/out/sdk/wasp/dist/universal/validators.d.ts waspJob/.wasp/out/sdk/wasp/dist/universal/validators.js waspJob/.wasp/out/sdk/wasp/dist/universal/validators.js.map waspJob/.wasp/out/sdk/wasp/entities/index.ts +waspJob/.wasp/out/sdk/wasp/env/index.ts +waspJob/.wasp/out/sdk/wasp/env/validation.ts waspJob/.wasp/out/sdk/wasp/ext-src/Main.css waspJob/.wasp/out/sdk/wasp/ext-src/MainPage.jsx waspJob/.wasp/out/sdk/wasp/ext-src/server/jobs/bar.js @@ -209,6 +224,7 @@ waspJob/.wasp/out/sdk/wasp/server/_types/serialization.ts waspJob/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts waspJob/.wasp/out/sdk/wasp/server/config.ts waspJob/.wasp/out/sdk/wasp/server/dbClient.ts +waspJob/.wasp/out/sdk/wasp/server/env.ts waspJob/.wasp/out/sdk/wasp/server/index.ts waspJob/.wasp/out/sdk/wasp/server/jobs/core/job.ts waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/index.ts @@ -241,7 +257,6 @@ waspJob/.wasp/out/server/README.md waspJob/.wasp/out/server/nodemon.json waspJob/.wasp/out/server/package.json waspJob/.wasp/out/server/rollup.config.js -waspJob/.wasp/out/server/scripts/validate-env.mjs waspJob/.wasp/out/server/src/app.js waspJob/.wasp/out/server/src/jobs/core/allJobs.ts waspJob/.wasp/out/server/src/jobs/scheduleJob.ts @@ -264,7 +279,6 @@ waspJob/.wasp/out/web-app/package.json waspJob/.wasp/out/web-app/public/.gitkeep waspJob/.wasp/out/web-app/public/favicon.ico waspJob/.wasp/out/web-app/public/manifest.json -waspJob/.wasp/out/web-app/scripts/validate-env.mjs waspJob/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx waspJob/.wasp/out/web-app/src/components/FullPageWrapper.tsx waspJob/.wasp/out/web-app/src/components/Loader.module.css 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 0468ae685a..f99f59fe34 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 @@ -18,14 +18,21 @@ "file", "../out/sdk/wasp/client/config.ts" ], - "d94e8bee5fd8f6793b511652b9ee558e57f4913595763137a5385cd929648168" + "4c5835ad64352cc87a4a17e41fd70333bc0d1eedd7339d7ad3d3507cdb64038d" + ], + [ + [ + "file", + "../out/sdk/wasp/client/env.ts" + ], + "2a3602d40b299fbfa1a6275fe67828d5653d9f3265ba8204b75178aa41dcbae0" ], [ [ "file", "../out/sdk/wasp/client/index.ts" ], - "2b3651e7040a63cfd6a271c2aa89f21cf01170e0abeb6c5ab74adde324852fe4" + "b55e5c34c2fdb50e608bcb4331fa2e67724f1fbfb21e1b93680b0f5fe2b7005a" ], [ [ @@ -167,6 +174,20 @@ ], "c59b97b122b977b5171686c92ee5ff2d80d397c2e83cc0915affb6ee136406fb" ], + [ + [ + "file", + "../out/sdk/wasp/env/index.ts" + ], + "d92b4832e9d4249ae5b1f00c0f9760d6841aa44bc199550414793a1d57a6845e" + ], + [ + [ + "file", + "../out/sdk/wasp/env/validation.ts" + ], + "e22b2fb8931275d3b1bd3176cbdbf753d22fc61887ded0e93cd8febf1b97d260" + ], [ [ "file", @@ -207,7 +228,7 @@ "file", "../out/sdk/wasp/package.json" ], - "c8e81e8cf56626b9051ba9bd6abc9ad7b3c41419f4b710c28b90382264396402" + "489fe48bafdb9893ee52621efcdefee11132f532ff07c22c9cca41fcb09ae6f3" ], [ [ @@ -221,7 +242,7 @@ "file", "../out/sdk/wasp/server/HttpError.ts" ], - "f375fb45eeb16381b8cc575503db302c005ddaa1b35d837ca0ea043fe8ec6ccb" + "9c1b2449d8e9d68470c6014054a3c3074069a104ddb291b9089c30d624a2d9d9" ], [ [ @@ -249,7 +270,7 @@ "file", "../out/sdk/wasp/server/config.ts" ], - "5dd35660e0969defaa3c180179919f4922ab7bc041746872dff7f2280c1872ae" + "8431eaf0332cdbdd2f36b4c232b4b6b65fd19bad58fe51922f5b2662f22fc8ad" ], [ [ @@ -258,12 +279,19 @@ ], "50f11eb232174184be5fd44e8ee3875c30707b486c8c70c3f7bfb93609d38e66" ], + [ + [ + "file", + "../out/sdk/wasp/server/env.ts" + ], + "f3cab17868417ffd4432dc4efecde72ccaaf099a79ddc9194835f3608d123b63" + ], [ [ "file", "../out/sdk/wasp/server/index.ts" ], - "51c3e0802764f72b88f6daaf148dba514ae817e233a40cc9b92ec91784f71f98" + "a8d2ffa7dfd0a13f7fb6135193bcdac1f860603bdd0ddc2843033fd4f6f6151f" ], [ [ @@ -284,7 +312,7 @@ "file", "../out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts" ], - "4c405b3cf98a4cea0ee906a46e4676ebe7ce08c1652c1b502403a93ebbbf943a" + "44ea6eb19cb4e283e24b4d3da1105539ef81cd36dfeb71d9fa5695f0b0c15b34" ], [ [ @@ -424,7 +452,7 @@ "file", "../out/sdk/wasp/universal/url.ts" ], - "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" + "58ff4ad8ffc79264d7215461571d909f3c5fb177ff32c67058d1da9cd4115d6e" ], [ [ @@ -452,7 +480,7 @@ "file", "Dockerfile" ], - "8851d4e81582d58921a5646dcf063b31dbf8ce9a46f3d4710360d2047dc644b5" + "20694e4dd2e7d96d8752ee3d792d4d8b63c46d7a4505c5312923a749146604b7" ], [ [ @@ -501,7 +529,7 @@ "file", "server/package.json" ], - "a4eb7e59ac5309fc5c39ccd7e19f4fdc7a9a568a3b393f62358ef6a6065d65c3" + "eaaa1e16e4962f38deb7220a7439a26b920ed7f852890242d084b4cebc63b7c3" ], [ [ @@ -510,13 +538,6 @@ ], "c1beb8264f11898364288d73b16f08d1923bac5f70038d9827978deb5b58a2da" ], - [ - [ - "file", - "server/scripts/validate-env.mjs" - ], - "100177b4326ccab7362eff378315d532ad1cc17cd28d1ed5978cb167fd627746" - ], [ [ "file", @@ -578,7 +599,7 @@ "file", "server/src/polyfill.ts" ], - "1149661e0aa7228b184bb2c04ac63232a6523b09b33829db6977f79daba3fd8d" + "f62c2088c8ebf5889ab479bb937ffd8f0f96d3e85483a7b088edebb5ae598dca" ], [ [ @@ -655,7 +676,7 @@ "file", "web-app/package.json" ], - "bd3bb0b696d11b21492b188790f36d1a09d50d154f3e171f2392406e02304561" + "961707cbde48e25403472b7604ee342e7064b06447307efdedce1098147c14c1" ], [ [ @@ -678,19 +699,12 @@ ], "f223cbdd7db93d51c3ecf8282a06801449b29bfb6821313c383c1b18ad8c1479" ], - [ - [ - "file", - "web-app/scripts/validate-env.mjs" - ], - "a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd" - ], [ [ "file", "web-app/src/components/DefaultRootErrorBoundary.tsx" ], - "4a141a28ca7aed9daddd75c156f7bae5eec50f3e5a85b6a43a28fa2648f34c44" + "73bbe8a2eb141e523c6b8169c0831e594b4ab6c7207f107d6d20c1561b44373a" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/Dockerfile b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/Dockerfile index 44152eecda..2c775ca6af 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/Dockerfile +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/Dockerfile @@ -50,15 +50,15 @@ WORKDIR /app # Copying the top level 'node_modules' because it contains the Prisma packages # necessary for migrating the database. COPY --from=server-builder /app/node_modules ./node_modules -# Copying the SDK because 'validate-env.mjs' executes independent of the bundle +# Copying the SDK because the server bundle doesn't bundle the SDK # and references the 'wasp' package. COPY --from=server-builder /app/.wasp/out/sdk .wasp/out/sdk -# Copying 'server/node_modules' because 'validate-env.mjs' executes independent -# of the bundle and references the dotenv package. +# Copying 'server/node_modules' because we require dotenv package to +# load environment variables +# TODO: replace dotenv with native Node.js environment variable loading COPY --from=server-builder /app/.wasp/build/server/node_modules .wasp/build/server/node_modules COPY --from=server-builder /app/.wasp/build/server/bundle .wasp/build/server/bundle COPY --from=server-builder /app/.wasp/build/server/package*.json .wasp/build/server/ -COPY --from=server-builder /app/.wasp/build/server/scripts .wasp/build/server/scripts COPY db/ .wasp/build/db/ EXPOSE ${PORT} WORKDIR /app/.wasp/build/server diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/installedNpmDepsLog.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/installedNpmDepsLog.json index b173928787..69b60feffb 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/installedNpmDepsLog.json +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/installedNpmDepsLog.json @@ -1 +1 @@ -{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.21.0"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^2.2.1"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"},{"name":"pg-boss","version":"^8.4.2"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"^16.0.2"},{"name":"express","version":"~4.21.0"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"superjson","version":"^2.2.1"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"}]}}} \ No newline at end of file +{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.21.0"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^2.2.1"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"},{"name":"pg-boss","version":"^8.4.2"},{"name":"zod","version":"^3.23.8"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"^16.0.2"},{"name":"express","version":"~4.21.0"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"superjson","version":"^2.2.1"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"}]}}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/config.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/config.ts index 82b0f80b6a..fff77cb01c 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/config.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/config.ts @@ -1,6 +1,7 @@ import { stripTrailingSlash } from '../universal/url.js' +import { env } from './env.js' -const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; +const apiUrl = stripTrailingSlash(env.REACT_APP_API_URL) // PUBLIC API export type ClientConfig = { diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/env.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/env.ts new file mode 100644 index 0000000000..8ddab287f7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/env.ts @@ -0,0 +1,18 @@ +import * as z from 'zod' + +import { ensureEnvSchema } from '../env/validation.js' + +const userClientEnvSchema = z.object({}) + +const waspClientEnvSchema = z.object({ + REACT_APP_API_URL: z + .string({ + required_error: 'REACT_APP_API_URL is required', + }) + .default('http://localhost:3001') +}) + +const clientEnvSchema = userClientEnvSchema.merge(waspClientEnvSchema) + +// PUBLIC API +export const env = ensureEnvSchema(import.meta.env, clientEnvSchema) diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/index.ts index cfce564c4d..859f8656b6 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/index.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/index.ts @@ -11,4 +11,7 @@ export enum HttpMethod { export type Route = { method: HttpMethod; path: string } // PUBLIC API -export { config, ClientConfig } from './config' +export { config, ClientConfig } from './config.js' + +// PUBLIC API +export { env } from './env.js' diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/config.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/config.js index 1dffbd68bc..7e6149f386 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/config.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/config.js @@ -1,5 +1,6 @@ import { stripTrailingSlash } from '../universal/url.js'; -const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; +import { env } from './env.js'; +const apiUrl = stripTrailingSlash(env.REACT_APP_API_URL); // PUBLIC API export const config = { apiUrl, diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/config.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/config.js.map index d26d37022b..f9e186b838 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/config.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAExD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;AAOxD,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/env.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/env.d.ts new file mode 100644 index 0000000000..5a9417a810 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/env.d.ts @@ -0,0 +1,3 @@ +export declare const env: { + REACT_APP_API_URL: string; +}; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/env.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/env.js new file mode 100644 index 0000000000..91164c3768 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/env.js @@ -0,0 +1,14 @@ +import * as z from 'zod'; +import { ensureEnvSchema } from '../env/validation.js'; +const userClientEnvSchema = z.object({}); +const waspClientEnvSchema = z.object({ + REACT_APP_API_URL: z + .string({ + required_error: 'REACT_APP_API_URL is required', + }) + .default('http://localhost:3001') +}); +const clientEnvSchema = userClientEnvSchema.merge(waspClientEnvSchema); +// PUBLIC API +export const env = ensureEnvSchema(import.meta.env, clientEnvSchema); +//# sourceMappingURL=env.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/env.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/env.js.map new file mode 100644 index 0000000000..d230f15c0d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/env.js.map @@ -0,0 +1 @@ +{"version":3,"file":"env.js","sourceRoot":"","sources":["../../client/env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,iBAAiB,EAAE,CAAC;SACjB,MAAM,CAAC;QACN,cAAc,EAAE,+BAA+B;KAChD,CAAC;SACD,OAAO,CAAC,uBAAuB,CAAC;CACpC,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,mBAAmB,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;AAEtE,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.d.ts index 7f5f4bfbc8..6498c439bd 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.d.ts @@ -8,4 +8,5 @@ export type Route = { method: HttpMethod; path: string; }; -export { config, ClientConfig } from './config'; +export { config, ClientConfig } from './config.js'; +export { env } from './env.js'; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.js index 5a7f13dcae..2f4daa7ae3 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.js @@ -8,5 +8,7 @@ export var HttpMethod; HttpMethod["Delete"] = "DELETE"; })(HttpMethod || (HttpMethod = {})); // PUBLIC API -export { config } from './config'; +export { config } from './config.js'; +// PUBLIC API +export { env } from './env.js'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.js.map index 879953c8df..f3611558dc 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,MAAM,EAAgB,MAAM,UAAU,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,MAAM,EAAgB,MAAM,aAAa,CAAA;AAElD,aAAa;AACb,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/index.d.ts new file mode 100644 index 0000000000..d1dafc25fd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/index.d.ts @@ -0,0 +1,3 @@ +import * as z from 'zod'; +export declare function defineEnvValidationSchema>(schema: Schema): Schema; +export { ensureEnvSchema } from './validation.js'; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/index.js new file mode 100644 index 0000000000..17e695d087 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/index.js @@ -0,0 +1,7 @@ +// PUBLIC API +export function defineEnvValidationSchema(schema) { + return schema; +} +// PRIVATE API (SDK, Vite config) +export { ensureEnvSchema } from './validation.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/index.js.map new file mode 100644 index 0000000000..75b4ff7de3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../env/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,MAAM,UAAU,yBAAyB,CACvC,MAAc;IAEd,OAAO,MAAM,CAAA;AACf,CAAC;AAED,iCAAiC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/validation.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/validation.d.ts new file mode 100644 index 0000000000..6bc9d059a3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/validation.d.ts @@ -0,0 +1,2 @@ +import * as z from 'zod'; +export declare function ensureEnvSchema(data: unknown, schema: Schema): z.infer; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/validation.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/validation.js new file mode 100644 index 0000000000..8463eb578e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/validation.js @@ -0,0 +1,23 @@ +import * as z from 'zod'; +const redColor = '\x1b[31m'; +export function ensureEnvSchema(data, schema) { + try { + return schema.parse(data); + } + catch (e) { + if (e instanceof z.ZodError) { + const errorOutput = ['', '══ Env vars validation failed ══', '']; + for (const error of e.errors) { + errorOutput.push(` - ${error.message}`); + } + errorOutput.push(''); + errorOutput.push('════════════════════════════════'); + console.error(redColor, errorOutput.join('\n')); + throw new Error('Error parsing environment variables'); + } + else { + throw e; + } + } +} +//# sourceMappingURL=validation.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/validation.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/validation.js.map new file mode 100644 index 0000000000..1d57b14a0b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/env/validation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../env/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,MAAM,QAAQ,GAAG,UAAU,CAAA;AAE3B,MAAM,UAAU,eAAe,CAC7B,IAAa,EACb,MAAc;IAEd,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;YAC5B,MAAM,WAAW,GAAG,CAAC,EAAE,EAAE,kCAAkC,EAAE,EAAE,CAAC,CAAA;YAChE,KAAK,MAAM,KAAK,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;gBAC7B,WAAW,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;YACzC,CAAC;YACD,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACpB,WAAW,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAA;YACpD,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;YAC/C,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;QACxD,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,CAAA;QACT,CAAC;IACH,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js.map index 8163354e1b..462e1c1811 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js.map @@ -1 +1 @@ -{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,OAAsB;QACvG,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YACE,UAAkB,EAClB,OAAgB,EAChB,IAA8B,EAC9B,OAAsB;QAEtB,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IACE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EACxE,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.d.ts index 68bb448c56..70f438bdf0 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.d.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.d.ts @@ -1,16 +1,13 @@ -type BaseConfig = { - allowedCORSOrigins: string | string[]; -}; -type CommonConfig = BaseConfig & { - env: string; +import { env } from './env.js'; +type NodeEnv = typeof env.NODE_ENV; +type Config = { + env: NodeEnv; isDevelopment: boolean; port: number; - databaseUrl: string | undefined; -}; -type EnvConfig = BaseConfig & { + databaseUrl: string; frontendUrl: string; serverUrl: string; + allowedCORSOrigins: string | string[]; }; -type Config = CommonConfig & EnvConfig; -declare const resolvedConfig: Config; -export default resolvedConfig; +declare const config: Config; +export default config; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js index e4f89082c8..dcc80722ab 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js @@ -1,43 +1,21 @@ -var _a; -import merge from 'lodash.merge'; -import { stripTrailingSlash } from "../universal/url.js"; -const nodeEnv = (_a = process.env.NODE_ENV) !== null && _a !== void 0 ? _a : 'development'; +import { env } from './env.js'; +import { stripTrailingSlash } from '../universal/url.js'; +const frontendUrl = stripTrailingSlash(env.WASP_WEB_CLIENT_URL); +const serverUrl = stripTrailingSlash(env.WASP_SERVER_URL); +const allowedCORSOriginsPerEnv = { + development: '*', + production: [frontendUrl] +}; +const allowedCORSOrigins = allowedCORSOriginsPerEnv[env.NODE_ENV]; const config = { - all: { - env: nodeEnv, - isDevelopment: nodeEnv === 'development', - port: process.env.PORT ? parseInt(process.env.PORT) : 3001, - databaseUrl: process.env.DATABASE_URL, - allowedCORSOrigins: [], - }, - development: getDevelopmentConfig(), - production: getProductionConfig(), + frontendUrl, + serverUrl, + allowedCORSOrigins, + env: env.NODE_ENV, + isDevelopment: env.NODE_ENV === 'development', + port: env.PORT, + databaseUrl: env.DATABASE_URL, }; -const resolvedConfig = merge(config.all, config[nodeEnv]); // PUBLIC API -export default resolvedConfig; -function getDevelopmentConfig() { - var _a, _b; - const frontendUrl = stripTrailingSlash((_a = process.env.WASP_WEB_CLIENT_URL) !== null && _a !== void 0 ? _a : 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash((_b = process.env.WASP_SERVER_URL) !== null && _b !== void 0 ? _b : 'http://localhost:3001'); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - allowedCORSOrigins: '*', - }; -} -function getProductionConfig() { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - // @ts-ignore - allowedCORSOrigins: [frontendUrl], - }; -} +export default config; //# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js.map index e284580bbd..9fd077fa81 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,mCAAI,aAAa,CAAA;AAyBrD,MAAM,MAAM,GAIR;IACF,GAAG,EAAE;QACH,GAAG,EAAE,OAAO;QACZ,aAAa,EAAE,OAAO,KAAK,aAAa;QACxC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;QAC1D,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;KACvB;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;CAClC,CAAA;AAED,MAAM,cAAc,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACjE,aAAa;AACb,eAAe,cAAc,CAAA;AAE7B,SAAS,oBAAoB;;IAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,mBAAmB,mCAAI,wBAAwB,CAAC,CAAC;IACpG,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,eAAe,mCAAI,uBAAuB,CAAC,CAAC;IAC7F,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,kBAAkB,EAAE,GAAG;KACxB,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAClE,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,aAAa;QACb,kBAAkB,EAAE,CAAC,WAAW,CAAC;KAClC,CAAA;AACH,CAAC"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAcxD,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;AAC/D,MAAM,SAAS,GAAG,kBAAkB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;AAEzD,MAAM,wBAAwB,GAAuC;IACnE,WAAW,EAAE,GAAG;IAChB,UAAU,EAAE,CAAC,WAAW,CAAC;CAC1B,CAAA;AACD,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAEjE,MAAM,MAAM,GAAW;IACrB,WAAW;IACX,SAAS;IACT,kBAAkB;IAClB,GAAG,EAAE,GAAG,CAAC,QAAQ;IACjB,aAAa,EAAE,GAAG,CAAC,QAAQ,KAAK,aAAa;IAC7C,IAAI,EAAE,GAAG,CAAC,IAAI;IACd,WAAW,EAAE,GAAG,CAAC,YAAY;CAC9B,CAAA;AAED,aAAa;AACb,eAAe,MAAM,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/env.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/env.d.ts new file mode 100644 index 0000000000..667ea30e35 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/env.d.ts @@ -0,0 +1,17 @@ +export declare const env: { + PORT: number; + DATABASE_URL: string; + SKIP_EMAIL_VERIFICATION_IN_DEV: boolean; + NODE_ENV: "development"; + WASP_SERVER_URL: string; + WASP_WEB_CLIENT_URL: string; + PG_BOSS_NEW_OPTIONS?: string | undefined; +} | { + PORT: number; + DATABASE_URL: string; + SKIP_EMAIL_VERIFICATION_IN_DEV: boolean; + NODE_ENV: "production"; + WASP_SERVER_URL: string; + WASP_WEB_CLIENT_URL: string; + PG_BOSS_NEW_OPTIONS?: string | undefined; +}; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/env.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/env.js new file mode 100644 index 0000000000..1bfc3e0b6e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/env.js @@ -0,0 +1,55 @@ +import * as z from 'zod'; +import { ensureEnvSchema } from '../env/validation.js'; +const userServerEnvSchema = z.object({}); +const waspServerCommonSchema = z.object({ + PORT: z.coerce.number().default(3001), + DATABASE_URL: z.string({ + required_error: 'DATABASE_URL is required', + }), + PG_BOSS_NEW_OPTIONS: z.string().optional(), + SKIP_EMAIL_VERIFICATION_IN_DEV: z + .enum(['true', 'false'], { + message: 'SKIP_EMAIL_VERIFICATION_IN_DEV must be either "true" or "false"', + }) + .transform((value) => value === 'true') + .default('false'), +}); +const serverUrlSchema = z + .string({ + required_error: 'WASP_SERVER_URL is required', +}) + .url({ + message: 'WASP_SERVER_URL must be a valid URL', +}); +const clientUrlSchema = z + .string({ + required_error: 'WASP_WEB_CLIENT_URL is required', +}) + .url({ + message: 'WASP_WEB_CLIENT_URL must be a valid URL', +}); +// In development, we provide default values for some environment variables +// to make the development process easier. +const serverDevSchema = z.object({ + NODE_ENV: z.literal('development'), + WASP_SERVER_URL: serverUrlSchema + .default('http://localhost:3001'), + WASP_WEB_CLIENT_URL: clientUrlSchema + .default('http://localhost:3000/'), +}); +const serverProdSchema = z.object({ + NODE_ENV: z.literal('production'), + WASP_SERVER_URL: serverUrlSchema, + WASP_WEB_CLIENT_URL: clientUrlSchema, +}); +const serverCommonSchema = userServerEnvSchema.merge(waspServerCommonSchema); +const serverEnvSchema = z.discriminatedUnion('NODE_ENV', [ + serverDevSchema.merge(serverCommonSchema), + serverProdSchema.merge(serverCommonSchema) +]); +// PUBLIC API +export const env = ensureEnvSchema(process.env, serverEnvSchema); +function getRequiredEnvVarErrorMessage(featureName, envVarName) { + return `${envVarName} is required when using ${featureName}`; +} +//# sourceMappingURL=env.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/env.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/env.js.map new file mode 100644 index 0000000000..3dfa10e116 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/env.js.map @@ -0,0 +1 @@ +{"version":3,"file":"env.js","sourceRoot":"","sources":["../../server/env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACrC,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC;QACrB,cAAc,EAAE,0BAA0B;KAC3C,CAAC;IACF,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,8BAA8B,EAAE,CAAC;SAC9B,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACvB,OAAO,EAAE,iEAAiE;KAC3E,CAAC;SACD,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,MAAM,CAAC;SACtC,OAAO,CAAC,OAAO,CAAC;CACpB,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,CAAC;KACtB,MAAM,CAAC;IACN,cAAc,EAAE,6BAA6B;CAC9C,CAAC;KACD,GAAG,CAAC;IACH,OAAO,EAAE,qCAAqC;CAC/C,CAAC,CAAA;AAEJ,MAAM,eAAe,GAAG,CAAC;KACtB,MAAM,CAAC;IACN,cAAc,EAAE,iCAAiC;CAClD,CAAC;KACD,GAAG,CAAC;IACH,OAAO,EAAE,yCAAyC;CACnD,CAAC,CAAA;AAGJ,2EAA2E;AAC3E,0CAA0C;AAC1C,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAClC,eAAe,EAAE,eAAe;SAC7B,OAAO,CAAC,uBAAuB,CAAC;IACnC,mBAAmB,EAAE,eAAe;SACjC,OAAO,CAAC,wBAAwB,CAAC;CACrC,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IACjC,eAAe,EAAE,eAAe;IAChC,mBAAmB,EAAE,eAAe;CACrC,CAAC,CAAA;AAEF,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;AAC5E,MAAM,eAAe,GAAG,CAAC,CAAC,kBAAkB,CAAC,UAAU,EAAE;IACvD,eAAe,CAAC,KAAK,CAAC,kBAAkB,CAAC;IACzC,gBAAgB,CAAC,KAAK,CAAC,kBAAkB,CAAC;CAC3C,CAAC,CAAA;AAEF,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,eAAe,CAAC,CAAA;AAEhE,SAAS,6BAA6B,CAAC,WAAmB,EAAE,UAAkB;IAC5E,OAAO,GAAG,UAAU,2BAA2B,WAAW,EAAE,CAAA;AAC9D,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.d.ts index dee9613a53..a108f6123f 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.d.ts @@ -4,4 +4,5 @@ export { default as prisma } from './dbClient.js'; export { type ServerSetupFn } from './types/index.js'; export { HttpError } from './HttpError.js'; export { MiddlewareConfigFn } from './middleware/index.js'; +export { env } from './env.js'; export type DbSeedFn = (prisma: PrismaClient) => Promise; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.js index 0e53e0deab..8e75e6f78c 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.js @@ -4,4 +4,6 @@ export { default as config } from './config.js'; export { default as prisma } from './dbClient.js'; // PUBLIC API export { HttpError } from './HttpError.js'; +// PUBLIC API +export { env } from './env.js'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.js.map index b84ac1b303..87ed22f3af 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAA;AAC/C,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,eAAe,CAAA;AAGjD,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAA;AAC/C,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,eAAe,CAAA;AAGjD,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAG1C,aAAa;AACb,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js index d1feb61aed..8fe6f220bc 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js @@ -1,14 +1,14 @@ import PgBoss from 'pg-boss'; -import { config } from 'wasp/server'; +import { config, env } from '../../../index.js'; const boss = createPgBoss(); function createPgBoss() { let pgBossNewOptions = { connectionString: config.databaseUrl, }; // Add an escape hatch for advanced configuration of pg-boss to overwrite our defaults. - if (process.env.PG_BOSS_NEW_OPTIONS) { + if (env.PG_BOSS_NEW_OPTIONS) { try { - pgBossNewOptions = JSON.parse(process.env.PG_BOSS_NEW_OPTIONS); + pgBossNewOptions = JSON.parse(env.PG_BOSS_NEW_OPTIONS); } catch (_a) { console.error('Environment variable PG_BOSS_NEW_OPTIONS was not parsable by JSON.parse()!'); diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map index ebe3e7b855..c87ccbfc48 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js.map @@ -1 +1 @@ -{"version":3,"file":"pgBoss.js","sourceRoot":"","sources":["../../../../../server/jobs/core/pgBoss/pgBoss.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,MAAM,IAAI,GAAG,YAAY,EAAE,CAAA;AAE3B,SAAS,YAAY;IACnB,IAAI,gBAAgB,GAAG;QACrB,gBAAgB,EAAE,MAAM,CAAC,WAAW;KACrC,CAAA;IAED,uFAAuF;IACvF,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,CAAC;QACpC,IAAI,CAAC;YACH,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;QAChE,CAAC;QAAC,WAAM,CAAC;YACP,OAAO,CAAC,KAAK,CACX,4EAA4E,CAC7E,CAAA;QACH,CAAC;IACH,CAAC;IAED,OAAO,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAA;AACrC,CAAC;AAED,IAAI,oBAA4C,CAAA;AAChD,IAAI,mBAA2C,CAAA;AAC/C,cAAc;AACd,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IACnE,oBAAoB,GAAG,OAAO,CAAA;IAC9B,mBAAmB,GAAG,MAAM,CAAA;AAC9B,CAAC,CAAC,CAAA;AAEF,IAAK,YAKJ;AALD,WAAK,YAAY;IACf,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;AACjB,CAAC,EALI,YAAY,KAAZ,YAAY,QAKhB;AAED,IAAI,YAAY,GAAiB,YAAY,CAAC,SAAS,CAAA;AAEvD,cAAc;AACd;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,sEAAsE;IACtE,IAAI,YAAY,KAAK,YAAY,CAAC,SAAS,EAAE,CAAC;QAC5C,OAAM;IACR,CAAC;IACD,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAA;IACpC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;IAElC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;IACjD,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAA;QACzC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACpB,YAAY,GAAG,YAAY,CAAC,KAAK,CAAA;QACjC,mBAAmB,CAAC,IAAI,CAAC,CAAA;QACzB,OAAM;IACR,CAAC;IAED,oBAAoB,CAAC,IAAI,CAAC,CAAA;IAE1B,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;IAC/B,YAAY,GAAG,YAAY,CAAC,OAAO,CAAA;AACrC,CAAC"} \ No newline at end of file +{"version":3,"file":"pgBoss.js","sourceRoot":"","sources":["../../../../../server/jobs/core/pgBoss/pgBoss.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAE/C,MAAM,IAAI,GAAG,YAAY,EAAE,CAAA;AAE3B,SAAS,YAAY;IACnB,IAAI,gBAAgB,GAAG;QACrB,gBAAgB,EAAE,MAAM,CAAC,WAAW;KACrC,CAAA;IAED,uFAAuF;IACvF,IAAI,GAAG,CAAC,mBAAmB,EAAE,CAAC;QAC5B,IAAI,CAAC;YACH,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;QACxD,CAAC;QAAC,WAAM,CAAC;YACP,OAAO,CAAC,KAAK,CACX,4EAA4E,CAC7E,CAAA;QACH,CAAC;IACH,CAAC;IAED,OAAO,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAA;AACrC,CAAC;AAED,IAAI,oBAA4C,CAAA;AAChD,IAAI,mBAA2C,CAAA;AAC/C,cAAc;AACd,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IACnE,oBAAoB,GAAG,OAAO,CAAA;IAC9B,mBAAmB,GAAG,MAAM,CAAA;AAC9B,CAAC,CAAC,CAAA;AAEF,IAAK,YAKJ;AALD,WAAK,YAAY;IACf,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;AACjB,CAAC,EALI,YAAY,KAAZ,YAAY,QAKhB;AAED,IAAI,YAAY,GAAiB,YAAY,CAAC,SAAS,CAAA;AAEvD,cAAc;AACd;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,sEAAsE;IACtE,IAAI,YAAY,KAAK,YAAY,CAAC,SAAS,EAAE,CAAC;QAC5C,OAAM;IACR,CAAC;IACD,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAA;IACpC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;IAElC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;IACjD,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAA;QACzC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACpB,YAAY,GAAG,YAAY,CAAC,KAAK,CAAA;QACjC,mBAAmB,CAAC,IAAI,CAAC,CAAA;QACzB,OAAM;IACR,CAAC;IAED,oBAAoB,CAAC,IAAI,CAAC,CAAA;IAE1B,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;IAC/B,YAAY,GAAG,YAAY,CAAC,OAAO,CAAA;AACrC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/url.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/url.d.ts index aa893e7838..7ceb994694 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/url.d.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/url.d.ts @@ -1 +1,2 @@ -export declare function stripTrailingSlash(url?: string): string | undefined; +export declare function stripTrailingSlash(url: string): string; +export declare function stripTrailingSlash(url: undefined): undefined; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/url.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/url.js.map index a7bad96020..e236f1b977 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/url.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/url.js.map @@ -1 +1 @@ -{"version":3,"file":"url.js","sourceRoot":"","sources":["../../universal/url.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC3C,OAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC"} \ No newline at end of file +{"version":3,"file":"url.js","sourceRoot":"","sources":["../../universal/url.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC3C,OAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/env/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/env/index.ts new file mode 100644 index 0000000000..4c783125c1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/env/index.ts @@ -0,0 +1,11 @@ +import * as z from 'zod' + +// PUBLIC API +export function defineEnvValidationSchema>( + schema: Schema, +): Schema { + return schema +} + +// PRIVATE API (SDK, Vite config) +export { ensureEnvSchema } from './validation.js' diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/env/validation.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/env/validation.ts new file mode 100644 index 0000000000..a5bc334754 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/env/validation.ts @@ -0,0 +1,25 @@ +import * as z from 'zod' + +const redColor = '\x1b[31m' + +export function ensureEnvSchema( + data: unknown, + schema: Schema +): z.infer { + try { + return schema.parse(data) + } catch (e) { + if (e instanceof z.ZodError) { + const errorOutput = ['', '══ Env vars validation failed ══', ''] + for (const error of e.errors) { + errorOutput.push(` - ${error.message}`) + } + errorOutput.push('') + errorOutput.push('════════════════════════════════') + console.error(redColor, errorOutput.join('\n')) + throw new Error('Error parsing environment variables') + } else { + throw e + } + } +} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/package.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/package.json index ce5f990604..a78accf43a 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/package.json +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/package.json @@ -8,7 +8,6 @@ "axios": "^1.4.0", "express": "~4.21.0", "jsdom": "^21.1.1", - "lodash.merge": "^4.6.2", "mitt": "3.0.0", "msw": "^1.1.0", "pg-boss": "^8.4.2", @@ -17,7 +16,8 @@ "react-hook-form": "^7.45.4", "react-router-dom": "^6.26.2", "superjson": "^2.2.1", - "vitest": "^1.2.1" + "vitest": "^1.2.1", + "zod": "^3.23.8" }, "devDependencies": { "@tsconfig/node18": "latest", @@ -52,6 +52,7 @@ "./core/storage": "./dist/core/storage.js", "./dev": "./dist/dev/index.js", "./entities": "./dist/entities/index.js", + "./env": "./dist/env/index.js", "./ext-src/*": "./dist/ext-src/*.js", "./operations": "./dist/operations/index.js", "./operations/*": "./dist/operations/*", diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/HttpError.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/HttpError.ts index d05a2c841b..bce964712d 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/HttpError.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/HttpError.ts @@ -2,7 +2,12 @@ export class HttpError extends Error { public statusCode: number public data: unknown - constructor (statusCode: number, message?: string, data?: Record, options?: ErrorOptions) { + constructor( + statusCode: number, + message?: string, + data?: Record, + options?: ErrorOptions + ) { super(message, options) if (Error.captureStackTrace) { @@ -11,7 +16,9 @@ export class HttpError extends Error { this.name = this.constructor.name - if (!(Number.isInteger(statusCode) && statusCode >= 400 && statusCode < 600)) { + if ( + !(Number.isInteger(statusCode) && statusCode >= 400 && statusCode < 600) + ) { throw new Error('statusCode has to be integer in range [400, 600).') } this.statusCode = statusCode diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/config.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/config.ts index 1dc9bafb93..3a000a897f 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/config.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/config.ts @@ -1,73 +1,36 @@ -import merge from 'lodash.merge' +import { env } from './env.js' +import { stripTrailingSlash } from '../universal/url.js' -import { stripTrailingSlash } from "../universal/url.js"; +type NodeEnv = typeof env.NODE_ENV -const nodeEnv = process.env.NODE_ENV ?? 'development' - -// TODO: -// - Use dotenv library to consume env vars from a file. -// - Use convict library to define schema and validate env vars. -// https://codingsans.com/blog/node-config-best-practices - -type BaseConfig = { - allowedCORSOrigins: string | string[]; -} - -type CommonConfig = BaseConfig & { - env: string; +type Config = { + env: NodeEnv; isDevelopment: boolean; port: number; - databaseUrl: string | undefined; -} - -type EnvConfig = BaseConfig & { + databaseUrl: string; frontendUrl: string; serverUrl: string; + allowedCORSOrigins: string | string[]; } -type Config = CommonConfig & EnvConfig +const frontendUrl = stripTrailingSlash(env.WASP_WEB_CLIENT_URL) +const serverUrl = stripTrailingSlash(env.WASP_SERVER_URL) -const config: { - all: CommonConfig, - development: EnvConfig, - production: EnvConfig, -} = { - all: { - env: nodeEnv, - isDevelopment: nodeEnv === 'development', - port: process.env.PORT ? parseInt(process.env.PORT) : 3001, - databaseUrl: process.env.DATABASE_URL, - allowedCORSOrigins: [], - }, - development: getDevelopmentConfig(), - production: getProductionConfig(), +const allowedCORSOriginsPerEnv: Record = { + development: '*', + production: [frontendUrl] } - -const resolvedConfig: Config = merge(config.all, config[nodeEnv]) -// PUBLIC API -export default resolvedConfig - -function getDevelopmentConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL ?? 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL ?? 'http://localhost:3001'); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - allowedCORSOrigins: '*', - } +const allowedCORSOrigins = allowedCORSOriginsPerEnv[env.NODE_ENV] + +const config: Config = { + frontendUrl, + serverUrl, + allowedCORSOrigins, + env: env.NODE_ENV, + isDevelopment: env.NODE_ENV === 'development', + port: env.PORT, + databaseUrl: env.DATABASE_URL, } -function getProductionConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - // @ts-ignore - allowedCORSOrigins: [frontendUrl], - } -} +// PUBLIC API +export default config diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/env.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/env.ts new file mode 100644 index 0000000000..c1bd8f5c0f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/env.ts @@ -0,0 +1,65 @@ +import * as z from 'zod' + +import { ensureEnvSchema } from '../env/validation.js' + +const userServerEnvSchema = z.object({}) + +const waspServerCommonSchema = z.object({ + PORT: z.coerce.number().default(3001), + DATABASE_URL: z.string({ + required_error: 'DATABASE_URL is required', + }), + PG_BOSS_NEW_OPTIONS: z.string().optional(), + SKIP_EMAIL_VERIFICATION_IN_DEV: z + .enum(['true', 'false'], { + message: 'SKIP_EMAIL_VERIFICATION_IN_DEV must be either "true" or "false"', + }) + .transform((value) => value === 'true') + .default('false'), +}) + +const serverUrlSchema = z + .string({ + required_error: 'WASP_SERVER_URL is required', + }) + .url({ + message: 'WASP_SERVER_URL must be a valid URL', + }) + +const clientUrlSchema = z + .string({ + required_error: 'WASP_WEB_CLIENT_URL is required', + }) + .url({ + message: 'WASP_WEB_CLIENT_URL must be a valid URL', + }) + + +// In development, we provide default values for some environment variables +// to make the development process easier. +const serverDevSchema = z.object({ + NODE_ENV: z.literal('development'), + WASP_SERVER_URL: serverUrlSchema + .default('http://localhost:3001'), + WASP_WEB_CLIENT_URL: clientUrlSchema + .default('http://localhost:3000/'), +}) + +const serverProdSchema = z.object({ + NODE_ENV: z.literal('production'), + WASP_SERVER_URL: serverUrlSchema, + WASP_WEB_CLIENT_URL: clientUrlSchema, +}) + +const serverCommonSchema = userServerEnvSchema.merge(waspServerCommonSchema) +const serverEnvSchema = z.discriminatedUnion('NODE_ENV', [ + serverDevSchema.merge(serverCommonSchema), + serverProdSchema.merge(serverCommonSchema) +]) + +// PUBLIC API +export const env = ensureEnvSchema(process.env, serverEnvSchema) + +function getRequiredEnvVarErrorMessage(featureName: string, envVarName: string) { + return `${envVarName} is required when using ${featureName}` +} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/index.ts index 535077900b..0f95deb90a 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/index.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/index.ts @@ -10,6 +10,8 @@ export { type ServerSetupFn } from './types/index.js' export { HttpError } from './HttpError.js' // PUBLIC API export { MiddlewareConfigFn } from './middleware/index.js' +// PUBLIC API +export { env } from './env.js' // PUBLIC API export type DbSeedFn = (prisma: PrismaClient) => Promise diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts index a48992aad0..eed0cf23cc 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts @@ -1,5 +1,5 @@ import PgBoss from 'pg-boss' -import { config } from 'wasp/server' +import { config, env } from '../../../index.js' const boss = createPgBoss() @@ -9,9 +9,9 @@ function createPgBoss() { } // Add an escape hatch for advanced configuration of pg-boss to overwrite our defaults. - if (process.env.PG_BOSS_NEW_OPTIONS) { + if (env.PG_BOSS_NEW_OPTIONS) { try { - pgBossNewOptions = JSON.parse(process.env.PG_BOSS_NEW_OPTIONS) + pgBossNewOptions = JSON.parse(env.PG_BOSS_NEW_OPTIONS) } catch { console.error( 'Environment variable PG_BOSS_NEW_OPTIONS was not parsable by JSON.parse()!' diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/url.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/url.ts index d21c06c65c..126678dac9 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/url.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/url.ts @@ -1,3 +1,5 @@ +export function stripTrailingSlash(url: string): string +export function stripTrailingSlash(url: undefined): undefined export function stripTrailingSlash(url?: string): string | undefined { return url?.replace(/\/$/, ""); } 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 7a57413e11..51ec87354a 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 @@ -34,9 +34,8 @@ "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", - "start": "npm run validate-env && node --enable-source-maps -r dotenv/config bundle/server.js", + "start": "node --enable-source-maps -r dotenv/config bundle/server.js", "start-production": "NODE_ENV=production npm run start", - "validate-env": "node -r dotenv/config ./scripts/validate-env.mjs", "watch": "nodemon --exec 'npm run bundle-and-start || exit 1'" }, "type": "module", diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/scripts/validate-env.mjs deleted file mode 100644 index f6e50aceca..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/scripts/validate-env.mjs +++ /dev/null @@ -1,5 +0,0 @@ -import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; - -console.info("🔍 Validating environment variables..."); -throwIfNotValidAbsoluteURL(process.env.WASP_WEB_CLIENT_URL, 'Environment variable WASP_WEB_CLIENT_URL'); -throwIfNotValidAbsoluteURL(process.env.WASP_SERVER_URL, 'Environment variable WASP_SERVER_URL'); diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/polyfill.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/polyfill.ts index 7931d12eb0..9279daf6da 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/polyfill.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/polyfill.ts @@ -1,11 +1,10 @@ // This is a polyfill for Node.js 18 webcrypto API so Lucia can use it // for random number generation. -import { webcrypto } from "node:crypto"; +import { webcrypto } from 'node:crypto' // NOTE: node < 19 doesn't have Crypto API, which we need for Lucia, so we apply the polyfill if Crypto API is not defined. -if (typeof globalThis.crypto === "undefined") { +if (typeof globalThis.crypto === 'undefined') { // @ts-ignore - globalThis.crypto = webcrypto as Crypto; + globalThis.crypto = webcrypto as Crypto } - diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/package.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/package.json index cd8a6c2ab1..ab966cfd02 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/package.json +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/package.json @@ -18,8 +18,7 @@ "devDependencies": { "@tsconfig/vite-react": "^2.0.0", "@types/react-dom": "^18.0.11", - "@vitejs/plugin-react": "^4.2.1", - "dotenv": "^16.0.3" + "@vitejs/plugin-react": "^4.2.1" }, "engineStrict": true, "engines": { @@ -28,9 +27,8 @@ "name": "waspJob", "private": true, "scripts": { - "build": "npm run validate-env && tsc && vite build", - "start": "npm run validate-env && vite", - "validate-env": "node -r dotenv/config ./scripts/validate-env.mjs" + "build": "tsc && vite build", + "start": "vite" }, "type": "module", "version": "0.0.0" diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/scripts/validate-env.mjs deleted file mode 100644 index 18ee507c9e..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/scripts/validate-env.mjs +++ /dev/null @@ -1,4 +0,0 @@ -import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; - -console.info("🔍 Validating environment variables..."); -throwIfNotValidAbsoluteURL(process.env.REACT_APP_API_URL, 'Environemnt variable REACT_APP_API_URL'); diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx index 7af24e15d6..1e931935e6 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx @@ -7,7 +7,10 @@ export function DefaultRootErrorBoundary() { console.error(error) return ( -
There was an error rendering this page. Check the browser console for more information.
+
+ There was an error rendering this page. Check the browser console for + more information. +
) } diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest b/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest index a5f519b0fb..cba21bfafc 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest @@ -10,6 +10,7 @@ waspMigrate/.wasp/out/installedNpmDepsLog.json waspMigrate/.wasp/out/sdk/wasp/api/events.ts waspMigrate/.wasp/out/sdk/wasp/api/index.ts waspMigrate/.wasp/out/sdk/wasp/client/config.ts +waspMigrate/.wasp/out/sdk/wasp/client/env.ts waspMigrate/.wasp/out/sdk/wasp/client/index.ts waspMigrate/.wasp/out/sdk/wasp/client/operations/actions/core.ts waspMigrate/.wasp/out/sdk/wasp/client/operations/actions/index.ts @@ -39,6 +40,9 @@ waspMigrate/.wasp/out/sdk/wasp/dist/api/index.js.map waspMigrate/.wasp/out/sdk/wasp/dist/client/config.d.ts waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/client/env.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/client/env.js +waspMigrate/.wasp/out/sdk/wasp/dist/client/env.js.map waspMigrate/.wasp/out/sdk/wasp/dist/client/index.d.ts waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js.map @@ -102,6 +106,12 @@ waspMigrate/.wasp/out/sdk/wasp/dist/dev/index.js.map waspMigrate/.wasp/out/sdk/wasp/dist/entities/index.d.ts waspMigrate/.wasp/out/sdk/wasp/dist/entities/index.js waspMigrate/.wasp/out/sdk/wasp/dist/entities/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/env/index.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/env/index.js +waspMigrate/.wasp/out/sdk/wasp/dist/env/index.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/env/validation.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/env/validation.js +waspMigrate/.wasp/out/sdk/wasp/dist/env/validation.js.map waspMigrate/.wasp/out/sdk/wasp/dist/ext-src/MainPage.d.ts waspMigrate/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx waspMigrate/.wasp/out/sdk/wasp/dist/ext-src/MainPage.jsx.map @@ -123,6 +133,9 @@ waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js.map waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.d.ts waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.js waspMigrate/.wasp/out/sdk/wasp/dist/server/dbClient.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/server/env.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/server/env.js +waspMigrate/.wasp/out/sdk/wasp/dist/server/env.js.map waspMigrate/.wasp/out/sdk/wasp/dist/server/index.d.ts waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js.map @@ -169,6 +182,8 @@ waspMigrate/.wasp/out/sdk/wasp/dist/universal/validators.d.ts waspMigrate/.wasp/out/sdk/wasp/dist/universal/validators.js waspMigrate/.wasp/out/sdk/wasp/dist/universal/validators.js.map waspMigrate/.wasp/out/sdk/wasp/entities/index.ts +waspMigrate/.wasp/out/sdk/wasp/env/index.ts +waspMigrate/.wasp/out/sdk/wasp/env/validation.ts waspMigrate/.wasp/out/sdk/wasp/ext-src/Main.css waspMigrate/.wasp/out/sdk/wasp/ext-src/MainPage.jsx waspMigrate/.wasp/out/sdk/wasp/ext-src/vite-env.d.ts @@ -181,6 +196,7 @@ waspMigrate/.wasp/out/sdk/wasp/server/_types/serialization.ts waspMigrate/.wasp/out/sdk/wasp/server/_types/taggedEntities.ts waspMigrate/.wasp/out/sdk/wasp/server/config.ts waspMigrate/.wasp/out/sdk/wasp/server/dbClient.ts +waspMigrate/.wasp/out/sdk/wasp/server/env.ts waspMigrate/.wasp/out/sdk/wasp/server/index.ts waspMigrate/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts waspMigrate/.wasp/out/sdk/wasp/server/middleware/index.ts @@ -204,7 +220,6 @@ waspMigrate/.wasp/out/server/README.md waspMigrate/.wasp/out/server/nodemon.json waspMigrate/.wasp/out/server/package.json waspMigrate/.wasp/out/server/rollup.config.js -waspMigrate/.wasp/out/server/scripts/validate-env.mjs waspMigrate/.wasp/out/server/src/app.js waspMigrate/.wasp/out/server/src/middleware/globalMiddleware.ts waspMigrate/.wasp/out/server/src/middleware/index.ts @@ -223,7 +238,6 @@ waspMigrate/.wasp/out/web-app/package.json waspMigrate/.wasp/out/web-app/public/.gitkeep waspMigrate/.wasp/out/web-app/public/favicon.ico waspMigrate/.wasp/out/web-app/public/manifest.json -waspMigrate/.wasp/out/web-app/scripts/validate-env.mjs waspMigrate/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx waspMigrate/.wasp/out/web-app/src/components/FullPageWrapper.tsx waspMigrate/.wasp/out/web-app/src/components/Loader.module.css 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 c72ec3182d..78f9ba7f9a 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 @@ -18,14 +18,21 @@ "file", "../out/sdk/wasp/client/config.ts" ], - "d94e8bee5fd8f6793b511652b9ee558e57f4913595763137a5385cd929648168" + "4c5835ad64352cc87a4a17e41fd70333bc0d1eedd7339d7ad3d3507cdb64038d" + ], + [ + [ + "file", + "../out/sdk/wasp/client/env.ts" + ], + "2a3602d40b299fbfa1a6275fe67828d5653d9f3265ba8204b75178aa41dcbae0" ], [ [ "file", "../out/sdk/wasp/client/index.ts" ], - "2b3651e7040a63cfd6a271c2aa89f21cf01170e0abeb6c5ab74adde324852fe4" + "b55e5c34c2fdb50e608bcb4331fa2e67724f1fbfb21e1b93680b0f5fe2b7005a" ], [ [ @@ -167,6 +174,20 @@ ], "c5077f0d9a9224986a1c42b54de449e48af1f2b9ecc8778eb44cd55ebd9d23a7" ], + [ + [ + "file", + "../out/sdk/wasp/env/index.ts" + ], + "d92b4832e9d4249ae5b1f00c0f9760d6841aa44bc199550414793a1d57a6845e" + ], + [ + [ + "file", + "../out/sdk/wasp/env/validation.ts" + ], + "e22b2fb8931275d3b1bd3176cbdbf753d22fc61887ded0e93cd8febf1b97d260" + ], [ [ "file", @@ -200,7 +221,7 @@ "file", "../out/sdk/wasp/package.json" ], - "6f1afd30c951e1f49740256440cd626c9cb521cf0822d93d2d2a5d63d8719d7b" + "b991fb5ade61a662dea3f21bf09aa30379f30ea76204a369c0800b1413256a64" ], [ [ @@ -214,7 +235,7 @@ "file", "../out/sdk/wasp/server/HttpError.ts" ], - "f375fb45eeb16381b8cc575503db302c005ddaa1b35d837ca0ea043fe8ec6ccb" + "9c1b2449d8e9d68470c6014054a3c3074069a104ddb291b9089c30d624a2d9d9" ], [ [ @@ -242,7 +263,7 @@ "file", "../out/sdk/wasp/server/config.ts" ], - "5dd35660e0969defaa3c180179919f4922ab7bc041746872dff7f2280c1872ae" + "8431eaf0332cdbdd2f36b4c232b4b6b65fd19bad58fe51922f5b2662f22fc8ad" ], [ [ @@ -251,12 +272,19 @@ ], "c5f88f028ad62b4a2fd5d1206aa72165f74c6f46f96250512af6ae55a5354020" ], + [ + [ + "file", + "../out/sdk/wasp/server/env.ts" + ], + "f3cab17868417ffd4432dc4efecde72ccaaf099a79ddc9194835f3608d123b63" + ], [ [ "file", "../out/sdk/wasp/server/index.ts" ], - "51c3e0802764f72b88f6daaf148dba514ae817e233a40cc9b92ec91784f71f98" + "a8d2ffa7dfd0a13f7fb6135193bcdac1f860603bdd0ddc2843033fd4f6f6151f" ], [ [ @@ -354,7 +382,7 @@ "file", "../out/sdk/wasp/universal/url.ts" ], - "8dc6e044a1a231b796465d94985ca47c5efd42a5d411b407a7d83a61ebae4b6d" + "58ff4ad8ffc79264d7215461571d909f3c5fb177ff32c67058d1da9cd4115d6e" ], [ [ @@ -382,7 +410,7 @@ "file", "Dockerfile" ], - "db2dae70d212749a7e758117e55f00968f84974d8307dc7d33154bf1429486c2" + "94b45c62cbed2fcb04c69643da5047c27c5eb0acb78b7c164d083a5c30e7c1d1" ], [ [ @@ -431,7 +459,7 @@ "file", "server/package.json" ], - "00ae054bb5597a45cc4e5277f88d24f4399fccabaa3614bf6ea89424fcd23480" + "ddda728300aaca5ccbd8342479cede7930cd5841c01f048415da8172314a1e0a" ], [ [ @@ -440,13 +468,6 @@ ], "c1beb8264f11898364288d73b16f08d1923bac5f70038d9827978deb5b58a2da" ], - [ - [ - "file", - "server/scripts/validate-env.mjs" - ], - "100177b4326ccab7362eff378315d532ad1cc17cd28d1ed5978cb167fd627746" - ], [ [ "file", @@ -480,7 +501,7 @@ "file", "server/src/polyfill.ts" ], - "1149661e0aa7228b184bb2c04ac63232a6523b09b33829db6977f79daba3fd8d" + "f62c2088c8ebf5889ab479bb937ffd8f0f96d3e85483a7b088edebb5ae598dca" ], [ [ @@ -557,7 +578,7 @@ "file", "web-app/package.json" ], - "c87e74f65917573dad902b8108ddce459af520bf7d3deb8cad6794fafa86749b" + "5ad3b71ea4267ee540ac1eb134ca61adf85869cb8ac86471e880725c3206b528" ], [ [ @@ -580,19 +601,12 @@ ], "c91b7ea515a4889c4abfd355500c8260210602093a94c0beee302450272c3737" ], - [ - [ - "file", - "web-app/scripts/validate-env.mjs" - ], - "a9a3a7eb6bc3ead49d8e3850a70737c93c789098beb3b40196bf145fd38893cd" - ], [ [ "file", "web-app/src/components/DefaultRootErrorBoundary.tsx" ], - "4a141a28ca7aed9daddd75c156f7bae5eec50f3e5a85b6a43a28fa2648f34c44" + "73bbe8a2eb141e523c6b8169c0831e594b4ab6c7207f107d6d20c1561b44373a" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/Dockerfile b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/Dockerfile index 76baedb0e0..9d828590a3 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/Dockerfile +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/Dockerfile @@ -52,15 +52,15 @@ WORKDIR /app # Copying the top level 'node_modules' because it contains the Prisma packages # necessary for migrating the database. COPY --from=server-builder /app/node_modules ./node_modules -# Copying the SDK because 'validate-env.mjs' executes independent of the bundle +# Copying the SDK because the server bundle doesn't bundle the SDK # and references the 'wasp' package. COPY --from=server-builder /app/.wasp/out/sdk .wasp/out/sdk -# Copying 'server/node_modules' because 'validate-env.mjs' executes independent -# of the bundle and references the dotenv package. +# Copying 'server/node_modules' because we require dotenv package to +# load environment variables +# TODO: replace dotenv with native Node.js environment variable loading COPY --from=server-builder /app/.wasp/build/server/node_modules .wasp/build/server/node_modules COPY --from=server-builder /app/.wasp/build/server/bundle .wasp/build/server/bundle COPY --from=server-builder /app/.wasp/build/server/package*.json .wasp/build/server/ -COPY --from=server-builder /app/.wasp/build/server/scripts .wasp/build/server/scripts COPY db/ .wasp/build/db/ EXPOSE ${PORT} WORKDIR /app/.wasp/build/server diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/installedNpmDepsLog.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/installedNpmDepsLog.json index a21ddcd4a1..d9bee4d2fa 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/installedNpmDepsLog.json +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/installedNpmDepsLog.json @@ -1 +1 @@ -{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.21.0"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"lodash.merge","version":"^4.6.2"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^2.2.1"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"},{"name":"dotenv","version":"^16.0.3"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"^16.0.2"},{"name":"express","version":"~4.21.0"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"superjson","version":"^2.2.1"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"}]}}} \ No newline at end of file +{"_waspSdkNpmDeps":{"dependencies":[{"name":"@prisma/client","version":"5.19.1"},{"name":"prisma","version":"5.19.1"},{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"},{"name":"express","version":"~4.21.0"},{"name":"mitt","version":"3.0.0"},{"name":"react","version":"^18.2.0"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"react-hook-form","version":"^7.45.4"},{"name":"superjson","version":"^2.2.1"},{"name":"vitest","version":"^1.2.1"},{"name":"@vitest/ui","version":"^1.2.1"},{"name":"jsdom","version":"^21.1.1"},{"name":"@testing-library/react","version":"^14.1.2"},{"name":"@testing-library/jest-dom","version":"^6.3.0"},{"name":"msw","version":"^1.1.0"},{"name":"zod","version":"^3.23.8"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/express-serve-static-core","version":"^4.17.13"}]},"_userNpmDeps":{"userDependencies":[{"name":"react","version":"^18.2.0"},{"name":"react-dom","version":"^18.2.0"},{"name":"react-router-dom","version":"^6.26.2"},{"name":"wasp","version":"file:.wasp/out/sdk/wasp"}],"userDevDependencies":[{"name":"@types/react","version":"^18.0.37"},{"name":"prisma","version":"5.19.1"},{"name":"typescript","version":"^5.1.0"},{"name":"vite","version":"^4.3.9"}]},"_waspFrameworkNpmDeps":{"npmDepsForWebApp":{"dependencies":[{"name":"@tanstack/react-query","version":"^4.29.0"},{"name":"axios","version":"^1.4.0"}],"devDependencies":[{"name":"@tsconfig/vite-react","version":"^2.0.0"},{"name":"@types/react-dom","version":"^18.0.11"},{"name":"@vitejs/plugin-react","version":"^4.2.1"}]},"npmDepsForServer":{"dependencies":[{"name":"cookie-parser","version":"~1.4.6"},{"name":"cors","version":"^2.8.5"},{"name":"dotenv","version":"^16.0.2"},{"name":"express","version":"~4.21.0"},{"name":"helmet","version":"^6.0.0"},{"name":"morgan","version":"~1.10.0"},{"name":"superjson","version":"^2.2.1"}],"devDependencies":[{"name":"@tsconfig/node18","version":"latest"},{"name":"@types/cors","version":"^2.8.5"},{"name":"@types/express","version":"^4.17.13"},{"name":"@types/express-serve-static-core","version":"^4.17.13"},{"name":"@types/node","version":"^18.0.0"},{"name":"nodemon","version":"^2.0.19"},{"name":"rollup","version":"^4.9.6"},{"name":"rollup-plugin-esbuild","version":"^6.1.1"}]}}} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/config.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/config.ts index 82b0f80b6a..fff77cb01c 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/config.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/config.ts @@ -1,6 +1,7 @@ import { stripTrailingSlash } from '../universal/url.js' +import { env } from './env.js' -const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; +const apiUrl = stripTrailingSlash(env.REACT_APP_API_URL) // PUBLIC API export type ClientConfig = { diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/env.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/env.ts new file mode 100644 index 0000000000..8ddab287f7 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/env.ts @@ -0,0 +1,18 @@ +import * as z from 'zod' + +import { ensureEnvSchema } from '../env/validation.js' + +const userClientEnvSchema = z.object({}) + +const waspClientEnvSchema = z.object({ + REACT_APP_API_URL: z + .string({ + required_error: 'REACT_APP_API_URL is required', + }) + .default('http://localhost:3001') +}) + +const clientEnvSchema = userClientEnvSchema.merge(waspClientEnvSchema) + +// PUBLIC API +export const env = ensureEnvSchema(import.meta.env, clientEnvSchema) diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/index.ts index cfce564c4d..859f8656b6 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/index.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/index.ts @@ -11,4 +11,7 @@ export enum HttpMethod { export type Route = { method: HttpMethod; path: string } // PUBLIC API -export { config, ClientConfig } from './config' +export { config, ClientConfig } from './config.js' + +// PUBLIC API +export { env } from './env.js' diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js index 1dffbd68bc..7e6149f386 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js @@ -1,5 +1,6 @@ import { stripTrailingSlash } from '../universal/url.js'; -const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; +import { env } from './env.js'; +const apiUrl = stripTrailingSlash(env.REACT_APP_API_URL); // PUBLIC API export const config = { apiUrl, diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js.map index d26d37022b..f9e186b838 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js.map +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAExD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;AAOxD,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/env.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/env.d.ts new file mode 100644 index 0000000000..5a9417a810 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/env.d.ts @@ -0,0 +1,3 @@ +export declare const env: { + REACT_APP_API_URL: string; +}; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/env.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/env.js new file mode 100644 index 0000000000..91164c3768 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/env.js @@ -0,0 +1,14 @@ +import * as z from 'zod'; +import { ensureEnvSchema } from '../env/validation.js'; +const userClientEnvSchema = z.object({}); +const waspClientEnvSchema = z.object({ + REACT_APP_API_URL: z + .string({ + required_error: 'REACT_APP_API_URL is required', + }) + .default('http://localhost:3001') +}); +const clientEnvSchema = userClientEnvSchema.merge(waspClientEnvSchema); +// PUBLIC API +export const env = ensureEnvSchema(import.meta.env, clientEnvSchema); +//# sourceMappingURL=env.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/env.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/env.js.map new file mode 100644 index 0000000000..d230f15c0d --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/env.js.map @@ -0,0 +1 @@ +{"version":3,"file":"env.js","sourceRoot":"","sources":["../../client/env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,iBAAiB,EAAE,CAAC;SACjB,MAAM,CAAC;QACN,cAAc,EAAE,+BAA+B;KAChD,CAAC;SACD,OAAO,CAAC,uBAAuB,CAAC;CACpC,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,mBAAmB,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;AAEtE,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.d.ts index 7f5f4bfbc8..6498c439bd 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.d.ts @@ -8,4 +8,5 @@ export type Route = { method: HttpMethod; path: string; }; -export { config, ClientConfig } from './config'; +export { config, ClientConfig } from './config.js'; +export { env } from './env.js'; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js index 5a7f13dcae..2f4daa7ae3 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js @@ -8,5 +8,7 @@ export var HttpMethod; HttpMethod["Delete"] = "DELETE"; })(HttpMethod || (HttpMethod = {})); // PUBLIC API -export { config } from './config'; +export { config } from './config.js'; +// PUBLIC API +export { env } from './env.js'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js.map index 879953c8df..f3611558dc 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js.map +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,MAAM,EAAgB,MAAM,UAAU,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,MAAM,EAAgB,MAAM,aAAa,CAAA;AAElD,aAAa;AACb,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/index.d.ts new file mode 100644 index 0000000000..d1dafc25fd --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/index.d.ts @@ -0,0 +1,3 @@ +import * as z from 'zod'; +export declare function defineEnvValidationSchema>(schema: Schema): Schema; +export { ensureEnvSchema } from './validation.js'; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/index.js new file mode 100644 index 0000000000..17e695d087 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/index.js @@ -0,0 +1,7 @@ +// PUBLIC API +export function defineEnvValidationSchema(schema) { + return schema; +} +// PRIVATE API (SDK, Vite config) +export { ensureEnvSchema } from './validation.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/index.js.map new file mode 100644 index 0000000000..75b4ff7de3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../env/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,MAAM,UAAU,yBAAyB,CACvC,MAAc;IAEd,OAAO,MAAM,CAAA;AACf,CAAC;AAED,iCAAiC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/validation.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/validation.d.ts new file mode 100644 index 0000000000..6bc9d059a3 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/validation.d.ts @@ -0,0 +1,2 @@ +import * as z from 'zod'; +export declare function ensureEnvSchema(data: unknown, schema: Schema): z.infer; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/validation.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/validation.js new file mode 100644 index 0000000000..8463eb578e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/validation.js @@ -0,0 +1,23 @@ +import * as z from 'zod'; +const redColor = '\x1b[31m'; +export function ensureEnvSchema(data, schema) { + try { + return schema.parse(data); + } + catch (e) { + if (e instanceof z.ZodError) { + const errorOutput = ['', '══ Env vars validation failed ══', '']; + for (const error of e.errors) { + errorOutput.push(` - ${error.message}`); + } + errorOutput.push(''); + errorOutput.push('════════════════════════════════'); + console.error(redColor, errorOutput.join('\n')); + throw new Error('Error parsing environment variables'); + } + else { + throw e; + } + } +} +//# sourceMappingURL=validation.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/validation.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/validation.js.map new file mode 100644 index 0000000000..1d57b14a0b --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/env/validation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../env/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,MAAM,QAAQ,GAAG,UAAU,CAAA;AAE3B,MAAM,UAAU,eAAe,CAC7B,IAAa,EACb,MAAc;IAEd,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;YAC5B,MAAM,WAAW,GAAG,CAAC,EAAE,EAAE,kCAAkC,EAAE,EAAE,CAAC,CAAA;YAChE,KAAK,MAAM,KAAK,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;gBAC7B,WAAW,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;YACzC,CAAC;YACD,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACpB,WAAW,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAA;YACpD,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;YAC/C,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;QACxD,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,CAAA;QACT,CAAC;IACH,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js.map index 8163354e1b..462e1c1811 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js.map +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js.map @@ -1 +1 @@ -{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,OAAsB;QACvG,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YACE,UAAkB,EAClB,OAAgB,EAChB,IAA8B,EAC9B,OAAsB;QAEtB,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IACE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EACxE,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.d.ts index 68bb448c56..70f438bdf0 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.d.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.d.ts @@ -1,16 +1,13 @@ -type BaseConfig = { - allowedCORSOrigins: string | string[]; -}; -type CommonConfig = BaseConfig & { - env: string; +import { env } from './env.js'; +type NodeEnv = typeof env.NODE_ENV; +type Config = { + env: NodeEnv; isDevelopment: boolean; port: number; - databaseUrl: string | undefined; -}; -type EnvConfig = BaseConfig & { + databaseUrl: string; frontendUrl: string; serverUrl: string; + allowedCORSOrigins: string | string[]; }; -type Config = CommonConfig & EnvConfig; -declare const resolvedConfig: Config; -export default resolvedConfig; +declare const config: Config; +export default config; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js index e4f89082c8..dcc80722ab 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js @@ -1,43 +1,21 @@ -var _a; -import merge from 'lodash.merge'; -import { stripTrailingSlash } from "../universal/url.js"; -const nodeEnv = (_a = process.env.NODE_ENV) !== null && _a !== void 0 ? _a : 'development'; +import { env } from './env.js'; +import { stripTrailingSlash } from '../universal/url.js'; +const frontendUrl = stripTrailingSlash(env.WASP_WEB_CLIENT_URL); +const serverUrl = stripTrailingSlash(env.WASP_SERVER_URL); +const allowedCORSOriginsPerEnv = { + development: '*', + production: [frontendUrl] +}; +const allowedCORSOrigins = allowedCORSOriginsPerEnv[env.NODE_ENV]; const config = { - all: { - env: nodeEnv, - isDevelopment: nodeEnv === 'development', - port: process.env.PORT ? parseInt(process.env.PORT) : 3001, - databaseUrl: process.env.DATABASE_URL, - allowedCORSOrigins: [], - }, - development: getDevelopmentConfig(), - production: getProductionConfig(), + frontendUrl, + serverUrl, + allowedCORSOrigins, + env: env.NODE_ENV, + isDevelopment: env.NODE_ENV === 'development', + port: env.PORT, + databaseUrl: env.DATABASE_URL, }; -const resolvedConfig = merge(config.all, config[nodeEnv]); // PUBLIC API -export default resolvedConfig; -function getDevelopmentConfig() { - var _a, _b; - const frontendUrl = stripTrailingSlash((_a = process.env.WASP_WEB_CLIENT_URL) !== null && _a !== void 0 ? _a : 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash((_b = process.env.WASP_SERVER_URL) !== null && _b !== void 0 ? _b : 'http://localhost:3001'); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - allowedCORSOrigins: '*', - }; -} -function getProductionConfig() { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - // @ts-ignore - allowedCORSOrigins: [frontendUrl], - }; -} +export default config; //# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js.map index e284580bbd..9fd077fa81 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js.map +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,mCAAI,aAAa,CAAA;AAyBrD,MAAM,MAAM,GAIR;IACF,GAAG,EAAE;QACH,GAAG,EAAE,OAAO;QACZ,aAAa,EAAE,OAAO,KAAK,aAAa;QACxC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;QAC1D,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;KACvB;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;CAClC,CAAA;AAED,MAAM,cAAc,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACjE,aAAa;AACb,eAAe,cAAc,CAAA;AAE7B,SAAS,oBAAoB;;IAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,mBAAmB,mCAAI,wBAAwB,CAAC,CAAC;IACpG,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,eAAe,mCAAI,uBAAuB,CAAC,CAAC;IAC7F,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,kBAAkB,EAAE,GAAG;KACxB,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAClE,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,aAAa;QACb,kBAAkB,EAAE,CAAC,WAAW,CAAC;KAClC,CAAA;AACH,CAAC"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAcxD,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;AAC/D,MAAM,SAAS,GAAG,kBAAkB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;AAEzD,MAAM,wBAAwB,GAAuC;IACnE,WAAW,EAAE,GAAG;IAChB,UAAU,EAAE,CAAC,WAAW,CAAC;CAC1B,CAAA;AACD,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAEjE,MAAM,MAAM,GAAW;IACrB,WAAW;IACX,SAAS;IACT,kBAAkB;IAClB,GAAG,EAAE,GAAG,CAAC,QAAQ;IACjB,aAAa,EAAE,GAAG,CAAC,QAAQ,KAAK,aAAa;IAC7C,IAAI,EAAE,GAAG,CAAC,IAAI;IACd,WAAW,EAAE,GAAG,CAAC,YAAY;CAC9B,CAAA;AAED,aAAa;AACb,eAAe,MAAM,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/env.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/env.d.ts new file mode 100644 index 0000000000..667ea30e35 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/env.d.ts @@ -0,0 +1,17 @@ +export declare const env: { + PORT: number; + DATABASE_URL: string; + SKIP_EMAIL_VERIFICATION_IN_DEV: boolean; + NODE_ENV: "development"; + WASP_SERVER_URL: string; + WASP_WEB_CLIENT_URL: string; + PG_BOSS_NEW_OPTIONS?: string | undefined; +} | { + PORT: number; + DATABASE_URL: string; + SKIP_EMAIL_VERIFICATION_IN_DEV: boolean; + NODE_ENV: "production"; + WASP_SERVER_URL: string; + WASP_WEB_CLIENT_URL: string; + PG_BOSS_NEW_OPTIONS?: string | undefined; +}; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/env.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/env.js new file mode 100644 index 0000000000..1bfc3e0b6e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/env.js @@ -0,0 +1,55 @@ +import * as z from 'zod'; +import { ensureEnvSchema } from '../env/validation.js'; +const userServerEnvSchema = z.object({}); +const waspServerCommonSchema = z.object({ + PORT: z.coerce.number().default(3001), + DATABASE_URL: z.string({ + required_error: 'DATABASE_URL is required', + }), + PG_BOSS_NEW_OPTIONS: z.string().optional(), + SKIP_EMAIL_VERIFICATION_IN_DEV: z + .enum(['true', 'false'], { + message: 'SKIP_EMAIL_VERIFICATION_IN_DEV must be either "true" or "false"', + }) + .transform((value) => value === 'true') + .default('false'), +}); +const serverUrlSchema = z + .string({ + required_error: 'WASP_SERVER_URL is required', +}) + .url({ + message: 'WASP_SERVER_URL must be a valid URL', +}); +const clientUrlSchema = z + .string({ + required_error: 'WASP_WEB_CLIENT_URL is required', +}) + .url({ + message: 'WASP_WEB_CLIENT_URL must be a valid URL', +}); +// In development, we provide default values for some environment variables +// to make the development process easier. +const serverDevSchema = z.object({ + NODE_ENV: z.literal('development'), + WASP_SERVER_URL: serverUrlSchema + .default('http://localhost:3001'), + WASP_WEB_CLIENT_URL: clientUrlSchema + .default('http://localhost:3000/'), +}); +const serverProdSchema = z.object({ + NODE_ENV: z.literal('production'), + WASP_SERVER_URL: serverUrlSchema, + WASP_WEB_CLIENT_URL: clientUrlSchema, +}); +const serverCommonSchema = userServerEnvSchema.merge(waspServerCommonSchema); +const serverEnvSchema = z.discriminatedUnion('NODE_ENV', [ + serverDevSchema.merge(serverCommonSchema), + serverProdSchema.merge(serverCommonSchema) +]); +// PUBLIC API +export const env = ensureEnvSchema(process.env, serverEnvSchema); +function getRequiredEnvVarErrorMessage(featureName, envVarName) { + return `${envVarName} is required when using ${featureName}`; +} +//# sourceMappingURL=env.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/env.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/env.js.map new file mode 100644 index 0000000000..3dfa10e116 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/env.js.map @@ -0,0 +1 @@ +{"version":3,"file":"env.js","sourceRoot":"","sources":["../../server/env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACrC,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC;QACrB,cAAc,EAAE,0BAA0B;KAC3C,CAAC;IACF,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,8BAA8B,EAAE,CAAC;SAC9B,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACvB,OAAO,EAAE,iEAAiE;KAC3E,CAAC;SACD,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,MAAM,CAAC;SACtC,OAAO,CAAC,OAAO,CAAC;CACpB,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,CAAC;KACtB,MAAM,CAAC;IACN,cAAc,EAAE,6BAA6B;CAC9C,CAAC;KACD,GAAG,CAAC;IACH,OAAO,EAAE,qCAAqC;CAC/C,CAAC,CAAA;AAEJ,MAAM,eAAe,GAAG,CAAC;KACtB,MAAM,CAAC;IACN,cAAc,EAAE,iCAAiC;CAClD,CAAC;KACD,GAAG,CAAC;IACH,OAAO,EAAE,yCAAyC;CACnD,CAAC,CAAA;AAGJ,2EAA2E;AAC3E,0CAA0C;AAC1C,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAClC,eAAe,EAAE,eAAe;SAC7B,OAAO,CAAC,uBAAuB,CAAC;IACnC,mBAAmB,EAAE,eAAe;SACjC,OAAO,CAAC,wBAAwB,CAAC;CACrC,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IACjC,eAAe,EAAE,eAAe;IAChC,mBAAmB,EAAE,eAAe;CACrC,CAAC,CAAA;AAEF,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;AAC5E,MAAM,eAAe,GAAG,CAAC,CAAC,kBAAkB,CAAC,UAAU,EAAE;IACvD,eAAe,CAAC,KAAK,CAAC,kBAAkB,CAAC;IACzC,gBAAgB,CAAC,KAAK,CAAC,kBAAkB,CAAC;CAC3C,CAAC,CAAA;AAEF,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,eAAe,CAAC,CAAA;AAEhE,SAAS,6BAA6B,CAAC,WAAmB,EAAE,UAAkB;IAC5E,OAAO,GAAG,UAAU,2BAA2B,WAAW,EAAE,CAAA;AAC9D,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.d.ts index dee9613a53..a108f6123f 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.d.ts @@ -4,4 +4,5 @@ export { default as prisma } from './dbClient.js'; export { type ServerSetupFn } from './types/index.js'; export { HttpError } from './HttpError.js'; export { MiddlewareConfigFn } from './middleware/index.js'; +export { env } from './env.js'; export type DbSeedFn = (prisma: PrismaClient) => Promise; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js index 0e53e0deab..8e75e6f78c 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js @@ -4,4 +4,6 @@ export { default as config } from './config.js'; export { default as prisma } from './dbClient.js'; // PUBLIC API export { HttpError } from './HttpError.js'; +// PUBLIC API +export { env } from './env.js'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js.map index b84ac1b303..87ed22f3af 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js.map +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAA;AAC/C,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,eAAe,CAAA;AAGjD,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/index.ts"],"names":[],"mappings":"AAEA,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAA;AAC/C,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,eAAe,CAAA;AAGjD,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAG1C,aAAa;AACb,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.d.ts index aa893e7838..7ceb994694 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.d.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.d.ts @@ -1 +1,2 @@ -export declare function stripTrailingSlash(url?: string): string | undefined; +export declare function stripTrailingSlash(url: string): string; +export declare function stripTrailingSlash(url: undefined): undefined; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.js.map index a7bad96020..e236f1b977 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.js.map +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/url.js.map @@ -1 +1 @@ -{"version":3,"file":"url.js","sourceRoot":"","sources":["../../universal/url.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC3C,OAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC"} \ No newline at end of file +{"version":3,"file":"url.js","sourceRoot":"","sources":["../../universal/url.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC3C,OAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/env/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/env/index.ts new file mode 100644 index 0000000000..4c783125c1 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/env/index.ts @@ -0,0 +1,11 @@ +import * as z from 'zod' + +// PUBLIC API +export function defineEnvValidationSchema>( + schema: Schema, +): Schema { + return schema +} + +// PRIVATE API (SDK, Vite config) +export { ensureEnvSchema } from './validation.js' diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/env/validation.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/env/validation.ts new file mode 100644 index 0000000000..a5bc334754 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/env/validation.ts @@ -0,0 +1,25 @@ +import * as z from 'zod' + +const redColor = '\x1b[31m' + +export function ensureEnvSchema( + data: unknown, + schema: Schema +): z.infer { + try { + return schema.parse(data) + } catch (e) { + if (e instanceof z.ZodError) { + const errorOutput = ['', '══ Env vars validation failed ══', ''] + for (const error of e.errors) { + errorOutput.push(` - ${error.message}`) + } + errorOutput.push('') + errorOutput.push('════════════════════════════════') + console.error(redColor, errorOutput.join('\n')) + throw new Error('Error parsing environment variables') + } else { + throw e + } + } +} diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/package.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/package.json index 2589c5362f..55c07a5084 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/package.json +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/package.json @@ -8,7 +8,6 @@ "axios": "^1.4.0", "express": "~4.21.0", "jsdom": "^21.1.1", - "lodash.merge": "^4.6.2", "mitt": "3.0.0", "msw": "^1.1.0", "prisma": "5.19.1", @@ -16,7 +15,8 @@ "react-hook-form": "^7.45.4", "react-router-dom": "^6.26.2", "superjson": "^2.2.1", - "vitest": "^1.2.1" + "vitest": "^1.2.1", + "zod": "^3.23.8" }, "devDependencies": { "@tsconfig/node18": "latest", @@ -51,6 +51,7 @@ "./core/storage": "./dist/core/storage.js", "./dev": "./dist/dev/index.js", "./entities": "./dist/entities/index.js", + "./env": "./dist/env/index.js", "./ext-src/*": "./dist/ext-src/*.js", "./operations": "./dist/operations/index.js", "./operations/*": "./dist/operations/*", diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/HttpError.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/HttpError.ts index d05a2c841b..bce964712d 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/HttpError.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/HttpError.ts @@ -2,7 +2,12 @@ export class HttpError extends Error { public statusCode: number public data: unknown - constructor (statusCode: number, message?: string, data?: Record, options?: ErrorOptions) { + constructor( + statusCode: number, + message?: string, + data?: Record, + options?: ErrorOptions + ) { super(message, options) if (Error.captureStackTrace) { @@ -11,7 +16,9 @@ export class HttpError extends Error { this.name = this.constructor.name - if (!(Number.isInteger(statusCode) && statusCode >= 400 && statusCode < 600)) { + if ( + !(Number.isInteger(statusCode) && statusCode >= 400 && statusCode < 600) + ) { throw new Error('statusCode has to be integer in range [400, 600).') } this.statusCode = statusCode diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/config.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/config.ts index 1dc9bafb93..3a000a897f 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/config.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/config.ts @@ -1,73 +1,36 @@ -import merge from 'lodash.merge' +import { env } from './env.js' +import { stripTrailingSlash } from '../universal/url.js' -import { stripTrailingSlash } from "../universal/url.js"; +type NodeEnv = typeof env.NODE_ENV -const nodeEnv = process.env.NODE_ENV ?? 'development' - -// TODO: -// - Use dotenv library to consume env vars from a file. -// - Use convict library to define schema and validate env vars. -// https://codingsans.com/blog/node-config-best-practices - -type BaseConfig = { - allowedCORSOrigins: string | string[]; -} - -type CommonConfig = BaseConfig & { - env: string; +type Config = { + env: NodeEnv; isDevelopment: boolean; port: number; - databaseUrl: string | undefined; -} - -type EnvConfig = BaseConfig & { + databaseUrl: string; frontendUrl: string; serverUrl: string; + allowedCORSOrigins: string | string[]; } -type Config = CommonConfig & EnvConfig +const frontendUrl = stripTrailingSlash(env.WASP_WEB_CLIENT_URL) +const serverUrl = stripTrailingSlash(env.WASP_SERVER_URL) -const config: { - all: CommonConfig, - development: EnvConfig, - production: EnvConfig, -} = { - all: { - env: nodeEnv, - isDevelopment: nodeEnv === 'development', - port: process.env.PORT ? parseInt(process.env.PORT) : 3001, - databaseUrl: process.env.DATABASE_URL, - allowedCORSOrigins: [], - }, - development: getDevelopmentConfig(), - production: getProductionConfig(), +const allowedCORSOriginsPerEnv: Record = { + development: '*', + production: [frontendUrl] } - -const resolvedConfig: Config = merge(config.all, config[nodeEnv]) -// PUBLIC API -export default resolvedConfig - -function getDevelopmentConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL ?? 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL ?? 'http://localhost:3001'); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - allowedCORSOrigins: '*', - } +const allowedCORSOrigins = allowedCORSOriginsPerEnv[env.NODE_ENV] + +const config: Config = { + frontendUrl, + serverUrl, + allowedCORSOrigins, + env: env.NODE_ENV, + isDevelopment: env.NODE_ENV === 'development', + port: env.PORT, + databaseUrl: env.DATABASE_URL, } -function getProductionConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); - return { - // @ts-ignore - frontendUrl, - // @ts-ignore - serverUrl, - // @ts-ignore - allowedCORSOrigins: [frontendUrl], - } -} +// PUBLIC API +export default config diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/env.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/env.ts new file mode 100644 index 0000000000..c1bd8f5c0f --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/env.ts @@ -0,0 +1,65 @@ +import * as z from 'zod' + +import { ensureEnvSchema } from '../env/validation.js' + +const userServerEnvSchema = z.object({}) + +const waspServerCommonSchema = z.object({ + PORT: z.coerce.number().default(3001), + DATABASE_URL: z.string({ + required_error: 'DATABASE_URL is required', + }), + PG_BOSS_NEW_OPTIONS: z.string().optional(), + SKIP_EMAIL_VERIFICATION_IN_DEV: z + .enum(['true', 'false'], { + message: 'SKIP_EMAIL_VERIFICATION_IN_DEV must be either "true" or "false"', + }) + .transform((value) => value === 'true') + .default('false'), +}) + +const serverUrlSchema = z + .string({ + required_error: 'WASP_SERVER_URL is required', + }) + .url({ + message: 'WASP_SERVER_URL must be a valid URL', + }) + +const clientUrlSchema = z + .string({ + required_error: 'WASP_WEB_CLIENT_URL is required', + }) + .url({ + message: 'WASP_WEB_CLIENT_URL must be a valid URL', + }) + + +// In development, we provide default values for some environment variables +// to make the development process easier. +const serverDevSchema = z.object({ + NODE_ENV: z.literal('development'), + WASP_SERVER_URL: serverUrlSchema + .default('http://localhost:3001'), + WASP_WEB_CLIENT_URL: clientUrlSchema + .default('http://localhost:3000/'), +}) + +const serverProdSchema = z.object({ + NODE_ENV: z.literal('production'), + WASP_SERVER_URL: serverUrlSchema, + WASP_WEB_CLIENT_URL: clientUrlSchema, +}) + +const serverCommonSchema = userServerEnvSchema.merge(waspServerCommonSchema) +const serverEnvSchema = z.discriminatedUnion('NODE_ENV', [ + serverDevSchema.merge(serverCommonSchema), + serverProdSchema.merge(serverCommonSchema) +]) + +// PUBLIC API +export const env = ensureEnvSchema(process.env, serverEnvSchema) + +function getRequiredEnvVarErrorMessage(featureName: string, envVarName: string) { + return `${envVarName} is required when using ${featureName}` +} diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/index.ts index 535077900b..0f95deb90a 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/index.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/index.ts @@ -10,6 +10,8 @@ export { type ServerSetupFn } from './types/index.js' export { HttpError } from './HttpError.js' // PUBLIC API export { MiddlewareConfigFn } from './middleware/index.js' +// PUBLIC API +export { env } from './env.js' // PUBLIC API export type DbSeedFn = (prisma: PrismaClient) => Promise diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/url.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/url.ts index d21c06c65c..126678dac9 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/url.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/url.ts @@ -1,3 +1,5 @@ +export function stripTrailingSlash(url: string): string +export function stripTrailingSlash(url: undefined): undefined export function stripTrailingSlash(url?: string): string | undefined { return url?.replace(/\/$/, ""); } 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 413d85a86f..e3d0d954da 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 @@ -34,9 +34,8 @@ "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", - "start": "npm run validate-env && node --enable-source-maps -r dotenv/config bundle/server.js", + "start": "node --enable-source-maps -r dotenv/config bundle/server.js", "start-production": "npm run db-migrate-prod && NODE_ENV=production npm run start", - "validate-env": "node -r dotenv/config ./scripts/validate-env.mjs", "watch": "nodemon --exec 'npm run bundle-and-start || exit 1'" }, "type": "module", diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/scripts/validate-env.mjs deleted file mode 100644 index f6e50aceca..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/scripts/validate-env.mjs +++ /dev/null @@ -1,5 +0,0 @@ -import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; - -console.info("🔍 Validating environment variables..."); -throwIfNotValidAbsoluteURL(process.env.WASP_WEB_CLIENT_URL, 'Environment variable WASP_WEB_CLIENT_URL'); -throwIfNotValidAbsoluteURL(process.env.WASP_SERVER_URL, 'Environment variable WASP_SERVER_URL'); diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/polyfill.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/polyfill.ts index 7931d12eb0..9279daf6da 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/polyfill.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/server/src/polyfill.ts @@ -1,11 +1,10 @@ // This is a polyfill for Node.js 18 webcrypto API so Lucia can use it // for random number generation. -import { webcrypto } from "node:crypto"; +import { webcrypto } from 'node:crypto' // NOTE: node < 19 doesn't have Crypto API, which we need for Lucia, so we apply the polyfill if Crypto API is not defined. -if (typeof globalThis.crypto === "undefined") { +if (typeof globalThis.crypto === 'undefined') { // @ts-ignore - globalThis.crypto = webcrypto as Crypto; + globalThis.crypto = webcrypto as Crypto } - diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/package.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/package.json index 8d93f8e94c..b80c6eea39 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/package.json +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/package.json @@ -18,8 +18,7 @@ "devDependencies": { "@tsconfig/vite-react": "^2.0.0", "@types/react-dom": "^18.0.11", - "@vitejs/plugin-react": "^4.2.1", - "dotenv": "^16.0.3" + "@vitejs/plugin-react": "^4.2.1" }, "engineStrict": true, "engines": { @@ -28,9 +27,8 @@ "name": "waspMigrate", "private": true, "scripts": { - "build": "npm run validate-env && tsc && vite build", - "start": "npm run validate-env && vite", - "validate-env": "node -r dotenv/config ./scripts/validate-env.mjs" + "build": "tsc && vite build", + "start": "vite" }, "type": "module", "version": "0.0.0" diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/scripts/validate-env.mjs b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/scripts/validate-env.mjs deleted file mode 100644 index 18ee507c9e..0000000000 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/scripts/validate-env.mjs +++ /dev/null @@ -1,4 +0,0 @@ -import { throwIfNotValidAbsoluteURL } from 'wasp/universal/validators'; - -console.info("🔍 Validating environment variables..."); -throwIfNotValidAbsoluteURL(process.env.REACT_APP_API_URL, 'Environemnt variable REACT_APP_API_URL'); diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx index 7af24e15d6..1e931935e6 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/web-app/src/components/DefaultRootErrorBoundary.tsx @@ -7,7 +7,10 @@ export function DefaultRootErrorBoundary() { console.error(error) return ( -
There was an error rendering this page. Check the browser console for more information.
+
+ There was an error rendering this page. Check the browser console for + more information. +
) } diff --git a/waspc/examples/todoApp/.env.server.example b/waspc/examples/todoApp/.env.server.example index 76df894076..08a8f0dd11 100644 --- a/waspc/examples/todoApp/.env.server.example +++ b/waspc/examples/todoApp/.env.server.example @@ -22,3 +22,5 @@ GITHUB_CLIENT_SECRET='dummy-gh-client-secret' # Dummy values here will allow app to run, but you will need real values to get Discord Auth to work. DISCORD_CLIENT_SECRET='dummy-discord-client-secret' DISCORD_CLIENT_ID='dummy-discord-client-id' + +MY_ENV_VAR=123 diff --git a/waspc/examples/todoApp/main.wasp b/waspc/examples/todoApp/main.wasp index 9cd2f4b1c6..f827d34e83 100644 --- a/waspc/examples/todoApp/main.wasp +++ b/waspc/examples/todoApp/main.wasp @@ -52,12 +52,14 @@ app todoApp { onAfterLogin: import { onAfterLogin } from "@src/auth/hooks.js", }, server: { - setupFn: import setup from "@src/serverSetup", + setupFn: import { setup } from "@src/serverSetup", middlewareConfigFn: import { serverMiddlewareFn } from "@src/serverSetup", + envValidationSchema: import { serverEnvValidationSchema } from "@src/env", }, client: { rootComponent: import { App } from "@src/App", - setupFn: import setup from "@src/clientSetup" + setupFn: import { setup } from "@src/clientSetup", + envValidationSchema: import { clientEnvValidationSchema } from "@src/env", }, db: { seeds: [ diff --git a/waspc/examples/todoApp/package-lock.json b/waspc/examples/todoApp/package-lock.json index 0e940179a5..9b072296ec 100644 --- a/waspc/examples/todoApp/package-lock.json +++ b/waspc/examples/todoApp/package-lock.json @@ -40,7 +40,6 @@ "axios": "^1.4.0", "express": "~4.21.0", "jsdom": "^21.1.1", - "lodash.merge": "^4.6.2", "lucia": "^3.0.1", "mitt": "3.0.0", "msw": "^1.1.0", @@ -56,7 +55,8 @@ "socket.io-client": "^4.6.1", "superjson": "^2.2.1", "tailwindcss": "^3.2.7", - "vitest": "^1.2.1" + "vitest": "^1.2.1", + "zod": "^3.23.8" }, "devDependencies": { "@tsconfig/node18": "latest", @@ -9966,6 +9966,14 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } } } diff --git a/waspc/data/Generator/templates/server/prettier.config.js b/waspc/examples/todoApp/prettier.config.cjs similarity index 56% rename from waspc/data/Generator/templates/server/prettier.config.js rename to waspc/examples/todoApp/prettier.config.cjs index 38597ed8a0..0614ee70c6 100644 --- a/waspc/data/Generator/templates/server/prettier.config.js +++ b/waspc/examples/todoApp/prettier.config.cjs @@ -1,4 +1,3 @@ -// Used for internal Wasp development only, not copied to generated app. module.exports = { trailingComma: 'es5', tabWidth: 2, diff --git a/waspc/examples/todoApp/prettier.config.js b/waspc/examples/todoApp/prettier.config.js deleted file mode 100644 index abcda7180c..0000000000 --- a/waspc/examples/todoApp/prettier.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - trailingComma: 'es5', - tabWidth: 2, - semi: false, - singleQuote: true, -} diff --git a/waspc/examples/todoApp/src/App.tsx b/waspc/examples/todoApp/src/App.tsx index e7f0fbb3b0..25b9867eb5 100644 --- a/waspc/examples/todoApp/src/App.tsx +++ b/waspc/examples/todoApp/src/App.tsx @@ -3,6 +3,7 @@ import { useSocket } from 'wasp/client/webSocket' import { Link } from 'wasp/client/router' import { logout, useAuth } from 'wasp/client/auth' import { useQuery, getDate } from 'wasp/client/operations' +import { env } from 'wasp/client' import './Main.css' import { getName } from './user' @@ -16,9 +17,7 @@ export function App() { const connectionIcon = isConnected ? '🟢' : '🔴' - const appName = import.meta.env.REACT_APP_NAME - ? import.meta.env.REACT_APP_NAME - : 'TODO App' + const appName = env.REACT_APP_NAME return (
diff --git a/waspc/examples/todoApp/src/clientSetup.js b/waspc/examples/todoApp/src/clientSetup.js index 35a39dd00d..fc35f6ec82 100644 --- a/waspc/examples/todoApp/src/clientSetup.js +++ b/waspc/examples/todoApp/src/clientSetup.js @@ -1,7 +1,7 @@ import { testingAction } from 'wasp/client/operations' import { sayHi } from './util' -export default function setup() { +export function setup() { console.log('This was called from the client setup function') testingAction() sayHi() diff --git a/waspc/examples/todoApp/src/env.ts b/waspc/examples/todoApp/src/env.ts new file mode 100644 index 0000000000..288f7a7ae1 --- /dev/null +++ b/waspc/examples/todoApp/src/env.ts @@ -0,0 +1,16 @@ +import * as z from 'zod' +import { defineEnvValidationSchema } from 'wasp/env' + +export const serverEnvValidationSchema = defineEnvValidationSchema( + z.object({ + MY_ENV_VAR: z.string({ + required_error: 'MY_ENV_VAR is required.', + }), + }) +) + +export const clientEnvValidationSchema = defineEnvValidationSchema( + z.object({ + REACT_APP_NAME: z.string().default('TODO App'), + }) +) diff --git a/waspc/examples/todoApp/src/serverSetup.ts b/waspc/examples/todoApp/src/serverSetup.ts index 09b73d42b2..1194f26cf0 100644 --- a/waspc/examples/todoApp/src/serverSetup.ts +++ b/waspc/examples/todoApp/src/serverSetup.ts @@ -2,6 +2,7 @@ import { type Application } from 'express' import { mySpecialJob } from 'wasp/server/jobs' import { config, + env, type MiddlewareConfigFn, type ServerSetupFn, } from 'wasp/server' @@ -13,7 +14,7 @@ let someResource: string | undefined = undefined export const getSomeResource = () => someResource -const setup: ServerSetupFn = async ({ app }) => { +export const setup: ServerSetupFn = async ({ app }) => { addCustomRoute(app) sayHi() @@ -33,6 +34,8 @@ const setup: ServerSetupFn = async ({ app }) => { 'submittedJob.pgBoss.details()', await submittedJob.pgBoss.details() ) + + console.log('Env var MY_ENV_VAR:', env.MY_ENV_VAR) } function addCustomRoute(app: Application) { @@ -51,5 +54,3 @@ export const serverMiddlewareFn: MiddlewareConfigFn = (middlewareConfig) => { ) return middlewareConfig } - -export default setup diff --git a/waspc/headless-test/examples/todoApp/.env.server.example b/waspc/headless-test/examples/todoApp/.env.server.example index c4b5c097c7..d0918e891b 100644 --- a/waspc/headless-test/examples/todoApp/.env.server.example +++ b/waspc/headless-test/examples/todoApp/.env.server.example @@ -1,3 +1,7 @@ GOOGLE_CLIENT_ID="mock-client-id" GOOGLE_CLIENT_SECRET="mock-client-secret" SKIP_EMAIL_VERIFICATION_IN_DEV=true +SMTP_HOST=dummy +SMTP_PORT=465 +SMTP_USERNAME=dummy +SMTP_PASSWORD=dummy diff --git a/waspc/headless-test/examples/todoApp/package-lock.json b/waspc/headless-test/examples/todoApp/package-lock.json index 482b8a1e19..ed9d984f8d 100644 --- a/waspc/headless-test/examples/todoApp/package-lock.json +++ b/waspc/headless-test/examples/todoApp/package-lock.json @@ -39,791 +39,31 @@ "axios": "^1.4.0", "express": "~4.21.0", "jsdom": "^21.1.1", - "lodash.merge": "^4.6.2", - "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", - "prisma": "5.19.1", - "react": "^18.2.0", - "react-hook-form": "^7.45.4", - "react-router-dom": "^6.26.2", - "superjson": "^2.2.1", - "tailwindcss": "^3.2.7", - "vitest": "^1.2.1" - }, - "devDependencies": { - "@tsconfig/node18": "latest", - "@types/express-serve-static-core": "^4.17.13" - } - }, - ".wasp/out/sdk/wasp/node_modules/@napi-rs/wasm-runtime": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.4.tgz", - "integrity": "sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==", - "optional": true, - "dependencies": { - "@emnapi/core": "^1.1.0", - "@emnapi/runtime": "^1.1.0", - "@tybys/wasm-util": "^0.9.0" - } - }, - ".wasp/out/sdk/wasp/node_modules/@napi-rs/wasm-runtime/node_modules/@emnapi/core": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.2.0.tgz", - "integrity": "sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==", - "optional": true, - "dependencies": { - "@emnapi/wasi-threads": "1.0.1", - "tslib": "^2.4.0" - } - }, - ".wasp/out/sdk/wasp/node_modules/@napi-rs/wasm-runtime/node_modules/@emnapi/runtime": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.2.0.tgz", - "integrity": "sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - ".wasp/out/sdk/wasp/node_modules/@napi-rs/wasm-runtime/node_modules/@tybys/wasm-util": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.9.0.tgz", - "integrity": "sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/argon2": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@node-rs/argon2/-/argon2-1.8.3.tgz", - "integrity": "sha512-sf/QAEI59hsMEEE2J8vO4hKrXrv4Oplte3KI2N4MhMDYpytH0drkVfErmHBfWFZxxIEK03fX1WsBNswS2nIZKg==", - "engines": { - "node": ">= 10" - }, - "optionalDependencies": { - "@node-rs/argon2-android-arm-eabi": "1.8.3", - "@node-rs/argon2-android-arm64": "1.8.3", - "@node-rs/argon2-darwin-arm64": "1.8.3", - "@node-rs/argon2-darwin-x64": "1.8.3", - "@node-rs/argon2-freebsd-x64": "1.8.3", - "@node-rs/argon2-linux-arm-gnueabihf": "1.8.3", - "@node-rs/argon2-linux-arm64-gnu": "1.8.3", - "@node-rs/argon2-linux-arm64-musl": "1.8.3", - "@node-rs/argon2-linux-x64-gnu": "1.8.3", - "@node-rs/argon2-linux-x64-musl": "1.8.3", - "@node-rs/argon2-wasm32-wasi": "1.8.3", - "@node-rs/argon2-win32-arm64-msvc": "1.8.3", - "@node-rs/argon2-win32-ia32-msvc": "1.8.3", - "@node-rs/argon2-win32-x64-msvc": "1.8.3" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/argon2-android-arm-eabi": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-android-arm-eabi/-/argon2-android-arm-eabi-1.8.3.tgz", - "integrity": "sha512-JFZPlNM0A8Og+Tncb8UZsQrhEMlbHBXPsT3hRoKImzVmTmq28Os0ucFWow0AACp2coLHBSydXH3Dh0lZup3rWw==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/argon2-android-arm64": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-android-arm64/-/argon2-android-arm64-1.8.3.tgz", - "integrity": "sha512-zaf8P3T92caeW2xnMA7P1QvRA4pIt/04oilYP44XlTCtMye//vwXDMeK53sl7dvYiJKnzAWDRx41k8vZvpZazg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/argon2-darwin-arm64": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-darwin-arm64/-/argon2-darwin-arm64-1.8.3.tgz", - "integrity": "sha512-DV/IbmLGdNXBtXb5o2UI5ba6kvqXqPAJgmMOTUCuHeBSp992GlLHdfU4rzGu0dNrxudBnunNZv+crd0YdEQSUA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/argon2-darwin-x64": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-darwin-x64/-/argon2-darwin-x64-1.8.3.tgz", - "integrity": "sha512-YMjmBGFZhLfYjfQ2gll9A+BZu/zAMV7lWZIbKxb7ZgEofILQwuGmExjDtY3Jplido/6leCEdpmlk2oIsME00LA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/argon2-freebsd-x64": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-freebsd-x64/-/argon2-freebsd-x64-1.8.3.tgz", - "integrity": "sha512-Hq3Rj5Yb2RolTG/luRPnv+XiGCbi5nAK25Pc8ou/tVapwX+iktEm/NXbxc5zsMxraYVkCvfdwBjweC5O+KqCGw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/argon2-linux-arm-gnueabihf": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-arm-gnueabihf/-/argon2-linux-arm-gnueabihf-1.8.3.tgz", - "integrity": "sha512-x49l8RgzKoG0/V0IXa5rrEl1TcJEc936ctlYFvqcunSOyowZ6kiWtrp1qrbOR8gbaNILl11KTF52vF6+h8UlEQ==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/argon2-linux-arm64-gnu": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-arm64-gnu/-/argon2-linux-arm64-gnu-1.8.3.tgz", - "integrity": "sha512-gJesam/qA63reGkb9qJ2TjFSLBtY41zQh2oei7nfnYsmVQPuHHWItJxEa1Bm21SPW53gZex4jFJbDIgj0+PxIw==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/argon2-linux-arm64-musl": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-arm64-musl/-/argon2-linux-arm64-musl-1.8.3.tgz", - "integrity": "sha512-7O6kQdSKzB4Tjx/EBa8zKIxnmLkQE8VdJgPm6Ksrpn+ueo0mx2xf76fIDnbbTCtm3UbB+y+FkTo2wLA7tOqIKg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/argon2-linux-x64-gnu": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-x64-gnu/-/argon2-linux-x64-gnu-1.8.3.tgz", - "integrity": "sha512-OBH+EFG7BGjFyldaao2H2gSCLmjtrrwf420B1L+lFn7JLW9UAjsIPFKAcWsYwPa/PwYzIge9Y7SGcpqlsSEX0w==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/argon2-linux-x64-musl": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-x64-musl/-/argon2-linux-x64-musl-1.8.3.tgz", - "integrity": "sha512-bDbMuyekIxZaN7NaX+gHVkOyABB8bcMEJYeRPW1vCXKHj3brJns1wiUFSxqeUXreupifNVJlQfPt1Y5B/vFXgQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/argon2-wasm32-wasi": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-wasm32-wasi/-/argon2-wasm32-wasi-1.8.3.tgz", - "integrity": "sha512-NBf2cMCDbNKMzp13Pog8ZPmI0M9U4Ak5b95EUjkp17kdKZFds12dwW67EMnj7Zy+pRqby2QLECaWebDYfNENTg==", - "cpu": [ - "wasm32" - ], - "optional": true, - "dependencies": { - "@napi-rs/wasm-runtime": "^0.2.3" - }, - "engines": { - "node": ">=14.0.0" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/argon2-win32-arm64-msvc": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-arm64-msvc/-/argon2-win32-arm64-msvc-1.8.3.tgz", - "integrity": "sha512-AHpPo7UbdW5WWjwreVpgFSY0o1RY4A7cUFaqDXZB2OqEuyrhMxBdZct9PX7PQKI18D85pLsODnR+gvVuTwJ6rQ==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/argon2-win32-ia32-msvc": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-ia32-msvc/-/argon2-win32-ia32-msvc-1.8.3.tgz", - "integrity": "sha512-bqzn2rcQkEwCINefhm69ttBVVkgHJb/V03DdBKsPFtiX6H47axXKz62d1imi26zFXhOEYxhKbu3js03GobJOLw==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/argon2-win32-x64-msvc": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-x64-msvc/-/argon2-win32-x64-msvc-1.8.3.tgz", - "integrity": "sha512-ILlrRThdbp5xNR5gwYM2ic1n/vG5rJ8dQZ+YMRqksl+lnTJ/6FDe5BOyIhiPtiDwlCiCtUA+1NxpDB9KlUCAIA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/bcrypt": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt/-/bcrypt-1.9.0.tgz", - "integrity": "sha512-u2OlIxW264bFUfvbFqDz9HZKFjwe8FHFtn7T/U8mYjPZ7DWYpbUB+/dkW/QgYfMSfR0ejkyuWaBBe0coW7/7ig==", - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - }, - "optionalDependencies": { - "@node-rs/bcrypt-android-arm-eabi": "1.9.0", - "@node-rs/bcrypt-android-arm64": "1.9.0", - "@node-rs/bcrypt-darwin-arm64": "1.9.0", - "@node-rs/bcrypt-darwin-x64": "1.9.0", - "@node-rs/bcrypt-freebsd-x64": "1.9.0", - "@node-rs/bcrypt-linux-arm-gnueabihf": "1.9.0", - "@node-rs/bcrypt-linux-arm64-gnu": "1.9.0", - "@node-rs/bcrypt-linux-arm64-musl": "1.9.0", - "@node-rs/bcrypt-linux-x64-gnu": "1.9.0", - "@node-rs/bcrypt-linux-x64-musl": "1.9.0", - "@node-rs/bcrypt-wasm32-wasi": "1.9.0", - "@node-rs/bcrypt-win32-arm64-msvc": "1.9.0", - "@node-rs/bcrypt-win32-ia32-msvc": "1.9.0", - "@node-rs/bcrypt-win32-x64-msvc": "1.9.0" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/bcrypt-android-arm-eabi": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-android-arm-eabi/-/bcrypt-android-arm-eabi-1.9.0.tgz", - "integrity": "sha512-nOCFISGtnodGHNiLrG0WYLWr81qQzZKYfmwHc7muUeq+KY0sQXyHOwZk9OuNQAWv/lnntmtbwkwT0QNEmOyLvA==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/bcrypt-android-arm64": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-android-arm64/-/bcrypt-android-arm64-1.9.0.tgz", - "integrity": "sha512-+ZrIAtigVmjYkqZQTThHVlz0+TG6D+GDHWhVKvR2DifjtqJ0i+mb9gjo++hN+fWEQdWNGxKCiBBjwgT4EcXd6A==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/bcrypt-darwin-arm64": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-darwin-arm64/-/bcrypt-darwin-arm64-1.9.0.tgz", - "integrity": "sha512-CQiS+F9Pa0XozvkXR1g7uXE9QvBOPOplDg0iCCPRYTN9PqA5qYxhwe48G3o+v2UeQceNRrbnEtWuANm7JRqIhw==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/bcrypt-darwin-x64": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-darwin-x64/-/bcrypt-darwin-x64-1.9.0.tgz", - "integrity": "sha512-4pTKGawYd7sNEjdJ7R/R67uwQH1VvwPZ0SSUMmeNHbxD5QlwAPXdDH11q22uzVXsvNFZ6nGQBg8No5OUGpx6Ug==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/bcrypt-freebsd-x64": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-freebsd-x64/-/bcrypt-freebsd-x64-1.9.0.tgz", - "integrity": "sha512-UmWzySX4BJhT/B8xmTru6iFif3h0Rpx3TqxRLCcbgmH43r7k5/9QuhpiyzpvKGpKHJCFNm4F3rC2wghvw5FCIg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/bcrypt-linux-arm-gnueabihf": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-arm-gnueabihf/-/bcrypt-linux-arm-gnueabihf-1.9.0.tgz", - "integrity": "sha512-8qoX4PgBND2cVwsbajoAWo3NwdfJPEXgpCsZQZURz42oMjbGyhhSYbovBCskGU3EBLoC8RA2B1jFWooeYVn5BA==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/bcrypt-linux-arm64-gnu": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-arm64-gnu/-/bcrypt-linux-arm64-gnu-1.9.0.tgz", - "integrity": "sha512-TuAC6kx0SbcIA4mSEWPi+OCcDjTQUMl213v5gMNlttF+D4ieIZx6pPDGTaMO6M2PDHTeCG0CBzZl0Lu+9b0c7Q==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/bcrypt-linux-arm64-musl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-arm64-musl/-/bcrypt-linux-arm64-musl-1.9.0.tgz", - "integrity": "sha512-/sIvKDABOI8QOEnLD7hIj02BVaNOuCIWBKvxcJOt8+TuwJ6zmY1UI5kSv9d99WbiHjTp97wtAUbZQwauU4b9ew==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/bcrypt-linux-x64-gnu": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-x64-gnu/-/bcrypt-linux-x64-gnu-1.9.0.tgz", - "integrity": "sha512-DyyhDHDsLBsCKz1tZ1hLvUZSc1DK0FU0v52jK6IBQxrj24WscSU9zZe7ie/V9kdmA4Ep57BfpWX8Dsa2JxGdgQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/bcrypt-linux-x64-musl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-x64-musl/-/bcrypt-linux-x64-musl-1.9.0.tgz", - "integrity": "sha512-duIiuqQ+Lew8ASSAYm6ZRqcmfBGWwsi81XLUwz86a2HR7Qv6V4yc3ZAUQovAikhjCsIqe8C11JlAZSK6+PlXYg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/bcrypt-wasm32-wasi": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-wasm32-wasi/-/bcrypt-wasm32-wasi-1.9.0.tgz", - "integrity": "sha512-ylaGmn9Wjwv/D5lxtawttx3H6Uu2WTTR7lWlRHGT6Ga/MB1Vj4OjSGUW8G8zIVnKuXpGbZ92pgHlt4HUpSLctw==", - "cpu": [ - "wasm32" - ], - "optional": true, - "dependencies": { - "@emnapi/core": "^0.45.0", - "@emnapi/runtime": "^0.45.0", - "@tybys/wasm-util": "^0.8.1", - "memfs-browser": "^3.4.13000" - }, - "engines": { - "node": ">=14.0.0" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/bcrypt-win32-arm64-msvc": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-win32-arm64-msvc/-/bcrypt-win32-arm64-msvc-1.9.0.tgz", - "integrity": "sha512-2h86gF7QFyEzODuDFml/Dp1MSJoZjxJ4yyT2Erf4NkwsiA5MqowUhUsorRwZhX6+2CtlGa7orbwi13AKMsYndw==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/bcrypt-win32-ia32-msvc": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-win32-ia32-msvc/-/bcrypt-win32-ia32-msvc-1.9.0.tgz", - "integrity": "sha512-kqxalCvhs4FkN0+gWWfa4Bdy2NQAkfiqq/CEf6mNXC13RSV673Ev9V8sRlQyNpCHCNkeXfOT9pgoBdJmMs9muA==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/@node-rs/bcrypt-win32-x64-msvc": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-win32-x64-msvc/-/bcrypt-win32-x64-msvc-1.9.0.tgz", - "integrity": "sha512-2y0Tuo6ZAT2Cz8V7DHulSlv1Bip3zbzeXyeur+uR25IRNYXKvI/P99Zl85Fbuu/zzYAZRLLlGTRe6/9IHofe/w==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/oslo": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/oslo/-/oslo-1.2.0.tgz", - "integrity": "sha512-OoFX6rDsNcOQVAD2gQD/z03u4vEjWZLzJtwkmgfRF+KpQUXwdgEXErD7zNhyowmHwHefP+PM9Pw13pgpHMRlzw==", - "dependencies": { - "@node-rs/argon2": "1.7.0", - "@node-rs/bcrypt": "1.9.0" - } - }, - ".wasp/out/sdk/wasp/node_modules/oslo/node_modules/@node-rs/argon2": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2/-/argon2-1.7.0.tgz", - "integrity": "sha512-zfULc+/tmcWcxn+nHkbyY8vP3+MpEqKORbszt4UkpqZgBgDAAIYvuDN/zukfTgdmo6tmJKKVfzigZOPk4LlIog==", - "engines": { - "node": ">= 10" - }, - "optionalDependencies": { - "@node-rs/argon2-android-arm-eabi": "1.7.0", - "@node-rs/argon2-android-arm64": "1.7.0", - "@node-rs/argon2-darwin-arm64": "1.7.0", - "@node-rs/argon2-darwin-x64": "1.7.0", - "@node-rs/argon2-freebsd-x64": "1.7.0", - "@node-rs/argon2-linux-arm-gnueabihf": "1.7.0", - "@node-rs/argon2-linux-arm64-gnu": "1.7.0", - "@node-rs/argon2-linux-arm64-musl": "1.7.0", - "@node-rs/argon2-linux-x64-gnu": "1.7.0", - "@node-rs/argon2-linux-x64-musl": "1.7.0", - "@node-rs/argon2-wasm32-wasi": "1.7.0", - "@node-rs/argon2-win32-arm64-msvc": "1.7.0", - "@node-rs/argon2-win32-ia32-msvc": "1.7.0", - "@node-rs/argon2-win32-x64-msvc": "1.7.0" - } - }, - ".wasp/out/sdk/wasp/node_modules/oslo/node_modules/@node-rs/argon2-android-arm-eabi": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-android-arm-eabi/-/argon2-android-arm-eabi-1.7.0.tgz", - "integrity": "sha512-udDqkr5P9E+wYX1SZwAVPdyfYvaF4ry9Tm+R9LkfSHbzWH0uhU6zjIwNRp7m+n4gx691rk+lqqDAIP8RLKwbhg==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/oslo/node_modules/@node-rs/argon2-android-arm64": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-android-arm64/-/argon2-android-arm64-1.7.0.tgz", - "integrity": "sha512-s9j/G30xKUx8WU50WIhF0fIl1EdhBGq0RQ06lEhZ0Gi0ap8lhqbE2Bn5h3/G2D1k0Dx+yjeVVNmt/xOQIRG38A==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/oslo/node_modules/@node-rs/argon2-darwin-arm64": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-darwin-arm64/-/argon2-darwin-arm64-1.7.0.tgz", - "integrity": "sha512-ZIz4L6HGOB9U1kW23g+m7anGNuTZ0RuTw0vNp3o+2DWpb8u8rODq6A8tH4JRL79S+Co/Nq608m9uackN2pe0Rw==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/oslo/node_modules/@node-rs/argon2-darwin-x64": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-darwin-x64/-/argon2-darwin-x64-1.7.0.tgz", - "integrity": "sha512-5oi/pxqVhODW/pj1+3zElMTn/YukQeywPHHYDbcAW3KsojFjKySfhcJMd1DjKTc+CHQI+4lOxZzSUzK7mI14Hw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/oslo/node_modules/@node-rs/argon2-freebsd-x64": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-freebsd-x64/-/argon2-freebsd-x64-1.7.0.tgz", - "integrity": "sha512-Ify08683hA4QVXYoIm5SUWOY5DPIT/CMB0CQT+IdxQAg/F+qp342+lUkeAtD5bvStQuCx/dFO3bnnzoe2clMhA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/oslo/node_modules/@node-rs/argon2-linux-arm-gnueabihf": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-arm-gnueabihf/-/argon2-linux-arm-gnueabihf-1.7.0.tgz", - "integrity": "sha512-7DjDZ1h5AUHAtRNjD19RnQatbhL+uuxBASuuXIBu4/w6Dx8n7YPxwTP4MXfsvuRgKuMWiOb/Ub/HJ3kXVCXRkg==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/oslo/node_modules/@node-rs/argon2-linux-arm64-gnu": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-arm64-gnu/-/argon2-linux-arm64-gnu-1.7.0.tgz", - "integrity": "sha512-nJDoMP4Y3YcqGswE4DvP080w6O24RmnFEDnL0emdI8Nou17kNYBzP2546Nasx9GCyLzRcYQwZOUjrtUuQ+od2g==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/oslo/node_modules/@node-rs/argon2-linux-arm64-musl": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-arm64-musl/-/argon2-linux-arm64-musl-1.7.0.tgz", - "integrity": "sha512-BKWS8iVconhE3jrb9mj6t1J9vwUqQPpzCbUKxfTGJfc+kNL58F1SXHBoe2cDYGnHrFEHTY0YochzXoAfm4Dm/A==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/oslo/node_modules/@node-rs/argon2-linux-x64-gnu": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-x64-gnu/-/argon2-linux-x64-gnu-1.7.0.tgz", - "integrity": "sha512-EmgqZOlf4Jurk/szW1iTsVISx25bKksVC5uttJDUloTgsAgIGReCpUUO1R24pBhu9ESJa47iv8NSf3yAfGv6jQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/oslo/node_modules/@node-rs/argon2-linux-x64-musl": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-x64-musl/-/argon2-linux-x64-musl-1.7.0.tgz", - "integrity": "sha512-/o1efYCYIxjfuoRYyBTi2Iy+1iFfhqHCvvVsnjNSgO1xWiWrX0Rrt/xXW5Zsl7vS2Y+yu8PL8KFWRzZhaVxfKA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/oslo/node_modules/@node-rs/argon2-wasm32-wasi": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-wasm32-wasi/-/argon2-wasm32-wasi-1.7.0.tgz", - "integrity": "sha512-Evmk9VcxqnuwQftfAfYEr6YZYSPLzmKUsbFIMep5nTt9PT4XYRFAERj7wNYp+rOcBenF3X4xoB+LhwcOMTNE5w==", - "cpu": [ - "wasm32" - ], - "optional": true, - "dependencies": { - "@emnapi/core": "^0.45.0", - "@emnapi/runtime": "^0.45.0", - "@tybys/wasm-util": "^0.8.1", - "memfs-browser": "^3.4.13000" + "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", + "prisma": "5.19.1", + "react": "^18.2.0", + "react-hook-form": "^7.45.4", + "react-router-dom": "^6.26.2", + "superjson": "^2.2.1", + "tailwindcss": "^3.2.7", + "vitest": "^1.2.1", + "zod": "^3.23.8" }, - "engines": { - "node": ">=14.0.0" - } - }, - ".wasp/out/sdk/wasp/node_modules/oslo/node_modules/@node-rs/argon2-win32-arm64-msvc": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-arm64-msvc/-/argon2-win32-arm64-msvc-1.7.0.tgz", - "integrity": "sha512-qgsU7T004COWWpSA0tppDqDxbPLgg8FaU09krIJ7FBl71Sz8SFO40h7fDIjfbTT5w7u6mcaINMQ5bSHu75PCaA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/oslo/node_modules/@node-rs/argon2-win32-ia32-msvc": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-ia32-msvc/-/argon2-win32-ia32-msvc-1.7.0.tgz", - "integrity": "sha512-JGafwWYQ/HpZ3XSwP4adQ6W41pRvhcdXvpzIWtKvX+17+xEXAe2nmGWM6s27pVkg1iV2ZtoYLRDkOUoGqZkCcg==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - ".wasp/out/sdk/wasp/node_modules/oslo/node_modules/@node-rs/argon2-win32-x64-msvc": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-x64-msvc/-/argon2-win32-x64-msvc-1.7.0.tgz", - "integrity": "sha512-9oq4ShyFakw8AG3mRls0AoCpxBFcimYx7+jvXeAf2OqKNO+mSA6eZ9z7KQeVCi0+SOEUYxMGf5UiGiDb9R6+9Q==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" + "devDependencies": { + "@tsconfig/node18": "latest", + "@types/express-serve-static-core": "^4.17.13" } }, "node_modules/@adobe/css-tools": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.3.tgz", - "integrity": "sha512-rE0Pygv0sEZ4vBWHlAgJLGDU7Pm8xoO6p3wsEceb7GYAjScrOHpEo8KK/eVkAcnSM+slAEtXjA2JpdjLp4fJQQ==" + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.1.tgz", + "integrity": "sha512-12WGKBQzjUAI4ayyF4IAtfw2QR/IDoqk6jTddXDhtYTJF9ASmoE1zst7cVtP0aL/F1jUJL5r+JxKXKEgHNbEUQ==" }, "node_modules/@alloc/quick-lru": { "version": "5.2.0", @@ -837,154 +77,30 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", - "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", "dependencies": { - "@babel/highlight": "^7.23.4", - "chalk": "^2.4.2" + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/code-frame/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/code-frame/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, - "node_modules/@babel/code-frame/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", - "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", - "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0" - }, + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/runtime": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.9.tgz", - "integrity": "sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz", + "integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -993,18 +109,19 @@ } }, "node_modules/@emnapi/core": { - "version": "0.45.0", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-0.45.0.tgz", - "integrity": "sha512-DPWjcUDQkCeEM4VnljEOEcXdAD7pp8zSZsgOujk/LGIwCXWbXJngin+MO4zbH429lzeC3WbYLGjE2MaUOwzpyw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.3.1.tgz", + "integrity": "sha512-pVGjBIt1Y6gg3EJN8jTcfpP/+uuRksIo055oE/OBkDNcjZqVbfkWCksG1Jp4yZnj3iKWyWX8fdG/j6UDYPbFog==", "optional": true, "dependencies": { + "@emnapi/wasi-threads": "1.0.1", "tslib": "^2.4.0" } }, "node_modules/@emnapi/runtime": { - "version": "0.45.0", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-0.45.0.tgz", - "integrity": "sha512-Txumi3td7J4A/xTTwlssKieHKTGl3j4A1tglBx72auZ49YK7ePY6XZricgIg9mnZT4xPfA+UPCUdnhRuEFDL+w==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.3.1.tgz", + "integrity": "sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==", "optional": true, "dependencies": { "tslib": "^2.4.0" @@ -1020,9 +137,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", - "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", "cpu": [ "ppc64" ], @@ -1414,52 +531,52 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.22", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", - "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@lucia-auth/adapter-prisma": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@lucia-auth/adapter-prisma/-/adapter-prisma-4.0.0.tgz", - "integrity": "sha512-TJg4/U1K1slS4A/OzDYCgmHTrIArntIynue14zGIEaMDu+OD+tGyq9WwQWqOabpx2Gm9xtDsoK+tTokAY3Up7A==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@lucia-auth/adapter-prisma/-/adapter-prisma-4.0.1.tgz", + "integrity": "sha512-3SztRhj1RAHbbhI/0aB7YC5zl6Z6aktPhkWpn2CHhiB03B9x/+A+M6pqJuAt1usU8PzkjVilgRPhrPymMar66A==", "peerDependencies": { "@prisma/client": "^4.2.0 || ^5.0.0", "lucia": "3.x" @@ -1496,11 +613,11 @@ } }, "node_modules/@mswjs/interceptors/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -1512,9 +629,9 @@ } }, "node_modules/@mswjs/interceptors/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/@mswjs/interceptors/node_modules/strict-event-emitter": { "version": "0.2.8", @@ -1525,44 +642,44 @@ } }, "node_modules/@napi-rs/wasm-runtime": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.1.1.tgz", - "integrity": "sha512-ATj9ua659JgrkICjJscaeZdmPr44cb/KFjNWuD0N6pux0SpzaM7+iOuuK11mAnQM2N9q0DT4REu6NkL8ZEhopw==", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.6.tgz", + "integrity": "sha512-z8YVS3XszxFTO73iwvFDNpQIzdMmSDTP/mB3E/ucR37V3Sx57hSExcXyMoNwaucWxnsWf4xfbZv0iZ30jr0M4Q==", "optional": true, "dependencies": { - "@emnapi/core": "^0.45.0", - "@emnapi/runtime": "^0.45.0", - "@tybys/wasm-util": "^0.8.1" + "@emnapi/core": "^1.3.1", + "@emnapi/runtime": "^1.3.1", + "@tybys/wasm-util": "^0.9.0" } }, "node_modules/@node-rs/argon2": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@node-rs/argon2/-/argon2-1.7.2.tgz", - "integrity": "sha512-+H6pc3M1vIX9YnG59YW7prHhhpv19P8YyxlXHnnFzTimf2q+kKDF7mGWbhvN9STqIY+P70Patn0Q6qb6Ib5/4g==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@node-rs/argon2/-/argon2-1.8.3.tgz", + "integrity": "sha512-sf/QAEI59hsMEEE2J8vO4hKrXrv4Oplte3KI2N4MhMDYpytH0drkVfErmHBfWFZxxIEK03fX1WsBNswS2nIZKg==", "engines": { "node": ">= 10" }, "optionalDependencies": { - "@node-rs/argon2-android-arm-eabi": "1.7.2", - "@node-rs/argon2-android-arm64": "1.7.2", - "@node-rs/argon2-darwin-arm64": "1.7.2", - "@node-rs/argon2-darwin-x64": "1.7.2", - "@node-rs/argon2-freebsd-x64": "1.7.2", - "@node-rs/argon2-linux-arm-gnueabihf": "1.7.2", - "@node-rs/argon2-linux-arm64-gnu": "1.7.2", - "@node-rs/argon2-linux-arm64-musl": "1.7.2", - "@node-rs/argon2-linux-x64-gnu": "1.7.2", - "@node-rs/argon2-linux-x64-musl": "1.7.2", - "@node-rs/argon2-wasm32-wasi": "1.7.2", - "@node-rs/argon2-win32-arm64-msvc": "1.7.2", - "@node-rs/argon2-win32-ia32-msvc": "1.7.2", - "@node-rs/argon2-win32-x64-msvc": "1.7.2" + "@node-rs/argon2-android-arm-eabi": "1.8.3", + "@node-rs/argon2-android-arm64": "1.8.3", + "@node-rs/argon2-darwin-arm64": "1.8.3", + "@node-rs/argon2-darwin-x64": "1.8.3", + "@node-rs/argon2-freebsd-x64": "1.8.3", + "@node-rs/argon2-linux-arm-gnueabihf": "1.8.3", + "@node-rs/argon2-linux-arm64-gnu": "1.8.3", + "@node-rs/argon2-linux-arm64-musl": "1.8.3", + "@node-rs/argon2-linux-x64-gnu": "1.8.3", + "@node-rs/argon2-linux-x64-musl": "1.8.3", + "@node-rs/argon2-wasm32-wasi": "1.8.3", + "@node-rs/argon2-win32-arm64-msvc": "1.8.3", + "@node-rs/argon2-win32-ia32-msvc": "1.8.3", + "@node-rs/argon2-win32-x64-msvc": "1.8.3" } }, "node_modules/@node-rs/argon2-android-arm-eabi": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-android-arm-eabi/-/argon2-android-arm-eabi-1.7.2.tgz", - "integrity": "sha512-WhW84XOzdR4AOGc4BJvIg5lCRVBL0pXp/PPCe8QCyWw493p7VdNCdYpr2xdtjS/0zImmY85HNB/6zpzjLRTT/A==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-android-arm-eabi/-/argon2-android-arm-eabi-1.8.3.tgz", + "integrity": "sha512-JFZPlNM0A8Og+Tncb8UZsQrhEMlbHBXPsT3hRoKImzVmTmq28Os0ucFWow0AACp2coLHBSydXH3Dh0lZup3rWw==", "cpu": [ "arm" ], @@ -1575,9 +692,9 @@ } }, "node_modules/@node-rs/argon2-android-arm64": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-android-arm64/-/argon2-android-arm64-1.7.2.tgz", - "integrity": "sha512-CdtayHSMIyDuVhSYFirwA757c4foQuyTjpysgFJLHweP9C7uDiBf9WBYij+UyabpaCadJ0wPyK6Vakinvlk4/g==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-android-arm64/-/argon2-android-arm64-1.8.3.tgz", + "integrity": "sha512-zaf8P3T92caeW2xnMA7P1QvRA4pIt/04oilYP44XlTCtMye//vwXDMeK53sl7dvYiJKnzAWDRx41k8vZvpZazg==", "cpu": [ "arm64" ], @@ -1590,9 +707,9 @@ } }, "node_modules/@node-rs/argon2-darwin-arm64": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-darwin-arm64/-/argon2-darwin-arm64-1.7.2.tgz", - "integrity": "sha512-hUOhtgYHTEyzX5sgMZVdXunONOus2HWpWydF5D/RYJ1mZ76FXRnFpQE40DqbzisdPIraKdn40m7JqkPP7wqdyg==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-darwin-arm64/-/argon2-darwin-arm64-1.8.3.tgz", + "integrity": "sha512-DV/IbmLGdNXBtXb5o2UI5ba6kvqXqPAJgmMOTUCuHeBSp992GlLHdfU4rzGu0dNrxudBnunNZv+crd0YdEQSUA==", "cpu": [ "arm64" ], @@ -1605,9 +722,9 @@ } }, "node_modules/@node-rs/argon2-darwin-x64": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-darwin-x64/-/argon2-darwin-x64-1.7.2.tgz", - "integrity": "sha512-lfs5HX+t542yUfcv6Aa/NeGD1nUCwyQNgnPEGcik71Ow6V13hkR1bHgmT1u3CHN4fBts0gW+DQEDsq1xlVgkvw==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-darwin-x64/-/argon2-darwin-x64-1.8.3.tgz", + "integrity": "sha512-YMjmBGFZhLfYjfQ2gll9A+BZu/zAMV7lWZIbKxb7ZgEofILQwuGmExjDtY3Jplido/6leCEdpmlk2oIsME00LA==", "cpu": [ "x64" ], @@ -1620,9 +737,9 @@ } }, "node_modules/@node-rs/argon2-freebsd-x64": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-freebsd-x64/-/argon2-freebsd-x64-1.7.2.tgz", - "integrity": "sha512-ROoF+4VaCBJUjddrTN1hjuqSl89ppRcjVXJscSPJjWzTlbzFmGGovJvIzUBmCr/Oq3yM1zKHj6MP9oRD5cB+/g==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-freebsd-x64/-/argon2-freebsd-x64-1.8.3.tgz", + "integrity": "sha512-Hq3Rj5Yb2RolTG/luRPnv+XiGCbi5nAK25Pc8ou/tVapwX+iktEm/NXbxc5zsMxraYVkCvfdwBjweC5O+KqCGw==", "cpu": [ "x64" ], @@ -1635,9 +752,9 @@ } }, "node_modules/@node-rs/argon2-linux-arm-gnueabihf": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-arm-gnueabihf/-/argon2-linux-arm-gnueabihf-1.7.2.tgz", - "integrity": "sha512-CBSB8KPI8LS74Bcz3dYaa2/khULutz4vSDvFWUERlSLX+mPdDhoZi6UPuUPPF9e01w8AbiK1YCqlLUTm3tIMfw==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-arm-gnueabihf/-/argon2-linux-arm-gnueabihf-1.8.3.tgz", + "integrity": "sha512-x49l8RgzKoG0/V0IXa5rrEl1TcJEc936ctlYFvqcunSOyowZ6kiWtrp1qrbOR8gbaNILl11KTF52vF6+h8UlEQ==", "cpu": [ "arm" ], @@ -1650,9 +767,9 @@ } }, "node_modules/@node-rs/argon2-linux-arm64-gnu": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-arm64-gnu/-/argon2-linux-arm64-gnu-1.7.2.tgz", - "integrity": "sha512-6LBTug6ZiWFakP3X3Nqs7ZTM03gmcSWX4YvEn20HhhQE5NDrsrw3zNqGj0cJiNzKKIMSDDuj7uGy+ITEfNo4CA==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-arm64-gnu/-/argon2-linux-arm64-gnu-1.8.3.tgz", + "integrity": "sha512-gJesam/qA63reGkb9qJ2TjFSLBtY41zQh2oei7nfnYsmVQPuHHWItJxEa1Bm21SPW53gZex4jFJbDIgj0+PxIw==", "cpu": [ "arm64" ], @@ -1665,9 +782,9 @@ } }, "node_modules/@node-rs/argon2-linux-arm64-musl": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-arm64-musl/-/argon2-linux-arm64-musl-1.7.2.tgz", - "integrity": "sha512-KjhQ+ZPne29t9VRVeIif7JdKwQba+tM6CBNYBoJB1iON0CUKeqSQtZcHuTj9gkf2SNRG5bsU4ABcfxd0OKsKHg==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-arm64-musl/-/argon2-linux-arm64-musl-1.8.3.tgz", + "integrity": "sha512-7O6kQdSKzB4Tjx/EBa8zKIxnmLkQE8VdJgPm6Ksrpn+ueo0mx2xf76fIDnbbTCtm3UbB+y+FkTo2wLA7tOqIKg==", "cpu": [ "arm64" ], @@ -1680,9 +797,9 @@ } }, "node_modules/@node-rs/argon2-linux-x64-gnu": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-x64-gnu/-/argon2-linux-x64-gnu-1.7.2.tgz", - "integrity": "sha512-BQvp+iLtKqomHz4q5t1aKoni9osgvUDU5sZtHAlFm5dRTlGHnympcQVATRE5GHyH9C6MIM9W7P1kqEeCLGPolQ==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-x64-gnu/-/argon2-linux-x64-gnu-1.8.3.tgz", + "integrity": "sha512-OBH+EFG7BGjFyldaao2H2gSCLmjtrrwf420B1L+lFn7JLW9UAjsIPFKAcWsYwPa/PwYzIge9Y7SGcpqlsSEX0w==", "cpu": [ "x64" ], @@ -1695,9 +812,9 @@ } }, "node_modules/@node-rs/argon2-linux-x64-musl": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-x64-musl/-/argon2-linux-x64-musl-1.7.2.tgz", - "integrity": "sha512-yXJudpBZQ98g+lWaHn9EzZ5KsAyqRdlpub/K+5NP7gHehb8wzBRIFAejIHAG0fvzQEEc86VOnV2koWIVZxWAvw==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-x64-musl/-/argon2-linux-x64-musl-1.8.3.tgz", + "integrity": "sha512-bDbMuyekIxZaN7NaX+gHVkOyABB8bcMEJYeRPW1vCXKHj3brJns1wiUFSxqeUXreupifNVJlQfPt1Y5B/vFXgQ==", "cpu": [ "x64" ], @@ -1710,24 +827,24 @@ } }, "node_modules/@node-rs/argon2-wasm32-wasi": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-wasm32-wasi/-/argon2-wasm32-wasi-1.7.2.tgz", - "integrity": "sha512-diXlVjJZY2GIV8ZDwUqXPhacXsFR0klGSv5D9f+XidwWXK4udtzDhkM/7N/Mb7h1HAWaxZ6IN9spYFjvWH1wqg==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-wasm32-wasi/-/argon2-wasm32-wasi-1.8.3.tgz", + "integrity": "sha512-NBf2cMCDbNKMzp13Pog8ZPmI0M9U4Ak5b95EUjkp17kdKZFds12dwW67EMnj7Zy+pRqby2QLECaWebDYfNENTg==", "cpu": [ "wasm32" ], "optional": true, "dependencies": { - "@napi-rs/wasm-runtime": "^0.1.1" + "@napi-rs/wasm-runtime": "^0.2.3" }, "engines": { "node": ">=14.0.0" } }, "node_modules/@node-rs/argon2-win32-arm64-msvc": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-arm64-msvc/-/argon2-win32-arm64-msvc-1.7.2.tgz", - "integrity": "sha512-dhIBrY04P9nbmwzBpgERQDmmSu4YBZyeEE32t4TikMz5rQ07iaVC+JpGmtCBZoDIsLDHGC8cikENd3YEqpqIcA==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-arm64-msvc/-/argon2-win32-arm64-msvc-1.8.3.tgz", + "integrity": "sha512-AHpPo7UbdW5WWjwreVpgFSY0o1RY4A7cUFaqDXZB2OqEuyrhMxBdZct9PX7PQKI18D85pLsODnR+gvVuTwJ6rQ==", "cpu": [ "arm64" ], @@ -1740,9 +857,9 @@ } }, "node_modules/@node-rs/argon2-win32-ia32-msvc": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-ia32-msvc/-/argon2-win32-ia32-msvc-1.7.2.tgz", - "integrity": "sha512-o1tfqr8gyALCzuxBoQfvhxkeYMaw/0H8Gmt7klTYyEIBvEFu7SD5qytXO9Px7t5420nZL/Wy5cflg3IB1s57Pg==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-ia32-msvc/-/argon2-win32-ia32-msvc-1.8.3.tgz", + "integrity": "sha512-bqzn2rcQkEwCINefhm69ttBVVkgHJb/V03DdBKsPFtiX6H47axXKz62d1imi26zFXhOEYxhKbu3js03GobJOLw==", "cpu": [ "ia32" ], @@ -1755,9 +872,9 @@ } }, "node_modules/@node-rs/argon2-win32-x64-msvc": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-x64-msvc/-/argon2-win32-x64-msvc-1.7.2.tgz", - "integrity": "sha512-v0h53XUc7hNgWiWi0qcMcHvj9/kwuItI9NwLK4C+gtzT3UB0cedhfIL8HFMKThMXasy41ZdbpCF2Bi0kJoLNEg==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-x64-msvc/-/argon2-win32-x64-msvc-1.8.3.tgz", + "integrity": "sha512-ILlrRThdbp5xNR5gwYM2ic1n/vG5rJ8dQZ+YMRqksl+lnTJ/6FDe5BOyIhiPtiDwlCiCtUA+1NxpDB9KlUCAIA==", "cpu": [ "x64" ], @@ -1770,9 +887,9 @@ } }, "node_modules/@node-rs/bcrypt": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt/-/bcrypt-1.9.2.tgz", - "integrity": "sha512-FKUo9iCSIti+ldwoOlY1ztyIFhZxEgT7jZ/UCt/9bg1rLmNdbQQD2JKIMImDCqmTWuLPY4ZF4Q5MyOMIfDCd8Q==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@node-rs/bcrypt/-/bcrypt-1.9.0.tgz", + "integrity": "sha512-u2OlIxW264bFUfvbFqDz9HZKFjwe8FHFtn7T/U8mYjPZ7DWYpbUB+/dkW/QgYfMSfR0ejkyuWaBBe0coW7/7ig==", "engines": { "node": ">= 10" }, @@ -1781,26 +898,26 @@ "url": "https://github.com/sponsors/Brooooooklyn" }, "optionalDependencies": { - "@node-rs/bcrypt-android-arm-eabi": "1.9.2", - "@node-rs/bcrypt-android-arm64": "1.9.2", - "@node-rs/bcrypt-darwin-arm64": "1.9.2", - "@node-rs/bcrypt-darwin-x64": "1.9.2", - "@node-rs/bcrypt-freebsd-x64": "1.9.2", - "@node-rs/bcrypt-linux-arm-gnueabihf": "1.9.2", - "@node-rs/bcrypt-linux-arm64-gnu": "1.9.2", - "@node-rs/bcrypt-linux-arm64-musl": "1.9.2", - "@node-rs/bcrypt-linux-x64-gnu": "1.9.2", - "@node-rs/bcrypt-linux-x64-musl": "1.9.2", - "@node-rs/bcrypt-wasm32-wasi": "1.9.2", - "@node-rs/bcrypt-win32-arm64-msvc": "1.9.2", - "@node-rs/bcrypt-win32-ia32-msvc": "1.9.2", - "@node-rs/bcrypt-win32-x64-msvc": "1.9.2" + "@node-rs/bcrypt-android-arm-eabi": "1.9.0", + "@node-rs/bcrypt-android-arm64": "1.9.0", + "@node-rs/bcrypt-darwin-arm64": "1.9.0", + "@node-rs/bcrypt-darwin-x64": "1.9.0", + "@node-rs/bcrypt-freebsd-x64": "1.9.0", + "@node-rs/bcrypt-linux-arm-gnueabihf": "1.9.0", + "@node-rs/bcrypt-linux-arm64-gnu": "1.9.0", + "@node-rs/bcrypt-linux-arm64-musl": "1.9.0", + "@node-rs/bcrypt-linux-x64-gnu": "1.9.0", + "@node-rs/bcrypt-linux-x64-musl": "1.9.0", + "@node-rs/bcrypt-wasm32-wasi": "1.9.0", + "@node-rs/bcrypt-win32-arm64-msvc": "1.9.0", + "@node-rs/bcrypt-win32-ia32-msvc": "1.9.0", + "@node-rs/bcrypt-win32-x64-msvc": "1.9.0" } }, "node_modules/@node-rs/bcrypt-android-arm-eabi": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-android-arm-eabi/-/bcrypt-android-arm-eabi-1.9.2.tgz", - "integrity": "sha512-er/Q2khwpan9pczvTTqY/DJE4UU65u31xd0NkZlHUTKyB7djRhWfzoGexGx2GN+k831/RR3U8kKE/8QUHeO3hQ==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-android-arm-eabi/-/bcrypt-android-arm-eabi-1.9.0.tgz", + "integrity": "sha512-nOCFISGtnodGHNiLrG0WYLWr81qQzZKYfmwHc7muUeq+KY0sQXyHOwZk9OuNQAWv/lnntmtbwkwT0QNEmOyLvA==", "cpu": [ "arm" ], @@ -1813,9 +930,9 @@ } }, "node_modules/@node-rs/bcrypt-android-arm64": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-android-arm64/-/bcrypt-android-arm64-1.9.2.tgz", - "integrity": "sha512-OUYatOEG5vbLbF73q2TC8UqrDO81zUQxnaFD/OAB1hcm6J+ur0zJ8E53c35/DIqkTp7JarPMraC4rouJ2ugN4w==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-android-arm64/-/bcrypt-android-arm64-1.9.0.tgz", + "integrity": "sha512-+ZrIAtigVmjYkqZQTThHVlz0+TG6D+GDHWhVKvR2DifjtqJ0i+mb9gjo++hN+fWEQdWNGxKCiBBjwgT4EcXd6A==", "cpu": [ "arm64" ], @@ -1828,9 +945,9 @@ } }, "node_modules/@node-rs/bcrypt-darwin-arm64": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-darwin-arm64/-/bcrypt-darwin-arm64-1.9.2.tgz", - "integrity": "sha512-svJKsGbzMAxOB5oluOYneN4YkKUy26WSMgm3KOIhgoX30IeMilj+2jFN/5qrI0oDZ0Iczb3XyL5DuZFtEkdP8A==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-darwin-arm64/-/bcrypt-darwin-arm64-1.9.0.tgz", + "integrity": "sha512-CQiS+F9Pa0XozvkXR1g7uXE9QvBOPOplDg0iCCPRYTN9PqA5qYxhwe48G3o+v2UeQceNRrbnEtWuANm7JRqIhw==", "cpu": [ "arm64" ], @@ -1843,9 +960,9 @@ } }, "node_modules/@node-rs/bcrypt-darwin-x64": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-darwin-x64/-/bcrypt-darwin-x64-1.9.2.tgz", - "integrity": "sha512-9OrySjBi/rWix8NZWD/TrNbNcwMY0pAiMHdL09aJnJ07uPih83GGh1pq4UHCYFCMy7iTX8swOmDlGBUImkOZbg==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-darwin-x64/-/bcrypt-darwin-x64-1.9.0.tgz", + "integrity": "sha512-4pTKGawYd7sNEjdJ7R/R67uwQH1VvwPZ0SSUMmeNHbxD5QlwAPXdDH11q22uzVXsvNFZ6nGQBg8No5OUGpx6Ug==", "cpu": [ "x64" ], @@ -1858,9 +975,9 @@ } }, "node_modules/@node-rs/bcrypt-freebsd-x64": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-freebsd-x64/-/bcrypt-freebsd-x64-1.9.2.tgz", - "integrity": "sha512-/djXV71RO6g5L1mI2pVvmp3x3pH7G4uKI3ODG1JBIXoz334oOcCMh40sB0uq0ljP8WEadker01p4T1rJE98fpg==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-freebsd-x64/-/bcrypt-freebsd-x64-1.9.0.tgz", + "integrity": "sha512-UmWzySX4BJhT/B8xmTru6iFif3h0Rpx3TqxRLCcbgmH43r7k5/9QuhpiyzpvKGpKHJCFNm4F3rC2wghvw5FCIg==", "cpu": [ "x64" ], @@ -1873,9 +990,9 @@ } }, "node_modules/@node-rs/bcrypt-linux-arm-gnueabihf": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-arm-gnueabihf/-/bcrypt-linux-arm-gnueabihf-1.9.2.tgz", - "integrity": "sha512-F7wP950OTAooxEleUN4I2hqryGZK7hi1cSgRF13Wvbc597RFux35KiSxIXUA3mNt2DE7lV2PeceEtCOScaThWQ==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-arm-gnueabihf/-/bcrypt-linux-arm-gnueabihf-1.9.0.tgz", + "integrity": "sha512-8qoX4PgBND2cVwsbajoAWo3NwdfJPEXgpCsZQZURz42oMjbGyhhSYbovBCskGU3EBLoC8RA2B1jFWooeYVn5BA==", "cpu": [ "arm" ], @@ -1888,9 +1005,9 @@ } }, "node_modules/@node-rs/bcrypt-linux-arm64-gnu": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-arm64-gnu/-/bcrypt-linux-arm64-gnu-1.9.2.tgz", - "integrity": "sha512-MehG+yQ0TgKMgKR1rO4hdvHkVsTM91Cof8qI9EJlS5+7+QSwfFA5O0zGwCkISD7bsyauJ5uJgcByGjpEobAHOg==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-arm64-gnu/-/bcrypt-linux-arm64-gnu-1.9.0.tgz", + "integrity": "sha512-TuAC6kx0SbcIA4mSEWPi+OCcDjTQUMl213v5gMNlttF+D4ieIZx6pPDGTaMO6M2PDHTeCG0CBzZl0Lu+9b0c7Q==", "cpu": [ "arm64" ], @@ -1903,9 +1020,9 @@ } }, "node_modules/@node-rs/bcrypt-linux-arm64-musl": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-arm64-musl/-/bcrypt-linux-arm64-musl-1.9.2.tgz", - "integrity": "sha512-PRZTAJjOwKEGsIhmBvfNh81So+wGl4QyCFAt23j+KwBujLStjC0N3YaqtTlWVKG9tcriPtmMYiAQtXWIyIgg/w==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-arm64-musl/-/bcrypt-linux-arm64-musl-1.9.0.tgz", + "integrity": "sha512-/sIvKDABOI8QOEnLD7hIj02BVaNOuCIWBKvxcJOt8+TuwJ6zmY1UI5kSv9d99WbiHjTp97wtAUbZQwauU4b9ew==", "cpu": [ "arm64" ], @@ -1918,9 +1035,9 @@ } }, "node_modules/@node-rs/bcrypt-linux-x64-gnu": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-x64-gnu/-/bcrypt-linux-x64-gnu-1.9.2.tgz", - "integrity": "sha512-5WfGO+O1m7nJ55WZ8XDq+ItA98Z4O7sNWsR+1nIj9YGT+Tx5zkQ2RBhpK6oCWZMluuZ0eKQ0FDmyP6K+2NDRIA==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-x64-gnu/-/bcrypt-linux-x64-gnu-1.9.0.tgz", + "integrity": "sha512-DyyhDHDsLBsCKz1tZ1hLvUZSc1DK0FU0v52jK6IBQxrj24WscSU9zZe7ie/V9kdmA4Ep57BfpWX8Dsa2JxGdgQ==", "cpu": [ "x64" ], @@ -1933,9 +1050,9 @@ } }, "node_modules/@node-rs/bcrypt-linux-x64-musl": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-x64-musl/-/bcrypt-linux-x64-musl-1.9.2.tgz", - "integrity": "sha512-VjCn0388p6PMCVUYHgYmHZrKNc7WwNJRr2WLJsHbQRGDOKbpNL6YolCjQxUchcSPDhzwrq1cIdy4j0fpoXEsdw==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-x64-musl/-/bcrypt-linux-x64-musl-1.9.0.tgz", + "integrity": "sha512-duIiuqQ+Lew8ASSAYm6ZRqcmfBGWwsi81XLUwz86a2HR7Qv6V4yc3ZAUQovAikhjCsIqe8C11JlAZSK6+PlXYg==", "cpu": [ "x64" ], @@ -1948,24 +1065,54 @@ } }, "node_modules/@node-rs/bcrypt-wasm32-wasi": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-wasm32-wasi/-/bcrypt-wasm32-wasi-1.9.2.tgz", - "integrity": "sha512-P06aHfMzm9makwU+nM7WA65yQnS1xuqJ8l/6I/LvXjnl+lfB3DtJ2B0CSLtjnUGpUgcHbWl5gEbNnTPxSAirjQ==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-wasm32-wasi/-/bcrypt-wasm32-wasi-1.9.0.tgz", + "integrity": "sha512-ylaGmn9Wjwv/D5lxtawttx3H6Uu2WTTR7lWlRHGT6Ga/MB1Vj4OjSGUW8G8zIVnKuXpGbZ92pgHlt4HUpSLctw==", "cpu": [ "wasm32" ], "optional": true, "dependencies": { - "@napi-rs/wasm-runtime": "^0.1.1" + "@emnapi/core": "^0.45.0", + "@emnapi/runtime": "^0.45.0", + "@tybys/wasm-util": "^0.8.1", + "memfs-browser": "^3.4.13000" }, "engines": { "node": ">=14.0.0" } }, + "node_modules/@node-rs/bcrypt-wasm32-wasi/node_modules/@emnapi/core": { + "version": "0.45.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-0.45.0.tgz", + "integrity": "sha512-DPWjcUDQkCeEM4VnljEOEcXdAD7pp8zSZsgOujk/LGIwCXWbXJngin+MO4zbH429lzeC3WbYLGjE2MaUOwzpyw==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@node-rs/bcrypt-wasm32-wasi/node_modules/@emnapi/runtime": { + "version": "0.45.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-0.45.0.tgz", + "integrity": "sha512-Txumi3td7J4A/xTTwlssKieHKTGl3j4A1tglBx72auZ49YK7ePY6XZricgIg9mnZT4xPfA+UPCUdnhRuEFDL+w==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@node-rs/bcrypt-wasm32-wasi/node_modules/@tybys/wasm-util": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.8.3.tgz", + "integrity": "sha512-Z96T/L6dUFFxgFJ+pQtkPpne9q7i6kIPYCFnQBHSgSPV9idTsKfIhCss0h5iM9irweZCatkrdeP8yi5uM1eX6Q==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@node-rs/bcrypt-win32-arm64-msvc": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-win32-arm64-msvc/-/bcrypt-win32-arm64-msvc-1.9.2.tgz", - "integrity": "sha512-Iyo/Q5/eNw27VRd3mLBgh1b9b5fnT3QHTVwxv3Siv/MRAIfJXH/cTOe18qSwYQzNh0ZioW4yemFPYCWSZi7szA==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-win32-arm64-msvc/-/bcrypt-win32-arm64-msvc-1.9.0.tgz", + "integrity": "sha512-2h86gF7QFyEzODuDFml/Dp1MSJoZjxJ4yyT2Erf4NkwsiA5MqowUhUsorRwZhX6+2CtlGa7orbwi13AKMsYndw==", "cpu": [ "arm64" ], @@ -1978,9 +1125,9 @@ } }, "node_modules/@node-rs/bcrypt-win32-ia32-msvc": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-win32-ia32-msvc/-/bcrypt-win32-ia32-msvc-1.9.2.tgz", - "integrity": "sha512-6LHWMaPylyyHoS5863YpxAACVB8DWCxro5W6pQ4h8WKSgHpJp8Um9jphTdN0A2w45HZjUnfcFuiFFC+TbftjCw==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-win32-ia32-msvc/-/bcrypt-win32-ia32-msvc-1.9.0.tgz", + "integrity": "sha512-kqxalCvhs4FkN0+gWWfa4Bdy2NQAkfiqq/CEf6mNXC13RSV673Ev9V8sRlQyNpCHCNkeXfOT9pgoBdJmMs9muA==", "cpu": [ "ia32" ], @@ -1993,9 +1140,9 @@ } }, "node_modules/@node-rs/bcrypt-win32-x64-msvc": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-win32-x64-msvc/-/bcrypt-win32-x64-msvc-1.9.2.tgz", - "integrity": "sha512-vZ9T1MOaYkLO9FTyl28YX0SYJneiYTKNFgM8PUv8nas8xrD+7OzokA0fEtlNp6413T7IKSD/iG9qi8nTWsiyGg==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-win32-x64-msvc/-/bcrypt-win32-x64-msvc-1.9.0.tgz", + "integrity": "sha512-2y0Tuo6ZAT2Cz8V7DHulSlv1Bip3zbzeXyeur+uR25IRNYXKvI/P99Zl85Fbuu/zzYAZRLLlGTRe6/9IHofe/w==", "cpu": [ "x64" ], @@ -2044,6 +1191,33 @@ "resolved": "https://registry.npmjs.org/@open-draft/until/-/until-1.0.3.tgz", "integrity": "sha512-Aq58f5HiWdyDlFffbbSjAlv596h/cOnt2DO1w3DOC7OJ5EHs0hd/nycJfiu9RJbT6Yk6F1knnRRXNSpxoIVZ9Q==" }, + "node_modules/@oslojs/asn1": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@oslojs/asn1/-/asn1-1.0.0.tgz", + "integrity": "sha512-zw/wn0sj0j0QKbIXfIlnEcTviaCzYOY3V5rAyjR6YtOByFtJiT574+8p9Wlach0lZH9fddD4yb9laEAIl4vXQA==", + "dependencies": { + "@oslojs/binary": "1.0.0" + } + }, + "node_modules/@oslojs/binary": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@oslojs/binary/-/binary-1.0.0.tgz", + "integrity": "sha512-9RCU6OwXU6p67H4NODbuxv2S3eenuQ4/WFLrsq+K/k682xrznH5EVWA7N4VFk9VYVcbFtKqur5YQQZc0ySGhsQ==" + }, + "node_modules/@oslojs/crypto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@oslojs/crypto/-/crypto-1.0.1.tgz", + "integrity": "sha512-7n08G8nWjAr/Yu3vu9zzrd0L9XnrJfpMioQcvCMxBIiF5orECHe5/3J0jmXRVvgfqMm/+4oxlQ+Sq39COYLcNQ==", + "dependencies": { + "@oslojs/asn1": "1.0.0", + "@oslojs/binary": "1.0.0" + } + }, + "node_modules/@oslojs/encoding": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@oslojs/encoding/-/encoding-1.1.0.tgz", + "integrity": "sha512-70wQhgYmndg4GCPxPPxPGevRKqTIJ2Nh4OkiMWmDAVYsTQ+Ta7Sq+rPevXyXGdzr30/qZBnyOalCszoMxlyldQ==" + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -2054,16 +1228,15 @@ } }, "node_modules/@polka/url": { - "version": "1.0.0-next.24", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.24.tgz", - "integrity": "sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ==" + "version": "1.0.0-next.28", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.28.tgz", + "integrity": "sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==" }, "node_modules/@prisma/client": { "version": "5.19.1", "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.19.1.tgz", "integrity": "sha512-x30GFguInsgt+4z5I4WbkZP2CGpotJMUXy+Gl/aaUjHn2o1DnLYNTA+q9XdYmAQZM8fIIkvUiA2NpgosM3fneg==", "hasInstallScript": true, - "license": "Apache-2.0", "engines": { "node": ">=16.13" }, @@ -2079,15 +1252,13 @@ "node_modules/@prisma/debug": { "version": "5.19.1", "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.19.1.tgz", - "integrity": "sha512-lAG6A6QnG2AskAukIEucYJZxxcSqKsMK74ZFVfCTOM/7UiyJQi48v6TQ47d6qKG3LbMslqOvnTX25dj/qvclGg==", - "license": "Apache-2.0" + "integrity": "sha512-lAG6A6QnG2AskAukIEucYJZxxcSqKsMK74ZFVfCTOM/7UiyJQi48v6TQ47d6qKG3LbMslqOvnTX25dj/qvclGg==" }, "node_modules/@prisma/engines": { "version": "5.19.1", "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.19.1.tgz", "integrity": "sha512-kR/PoxZDrfUmbbXqqb8SlBBgCjvGaJYMCOe189PEYzq9rKqitQ2fvT/VJ8PDSe8tTNxhc2KzsCfCAL+Iwm/7Cg==", "hasInstallScript": true, - "license": "Apache-2.0", "dependencies": { "@prisma/debug": "5.19.1", "@prisma/engines-version": "5.19.1-2.69d742ee20b815d88e17e54db4a2a7a3b30324e3", @@ -2098,14 +1269,12 @@ "node_modules/@prisma/engines-version": { "version": "5.19.1-2.69d742ee20b815d88e17e54db4a2a7a3b30324e3", "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.19.1-2.69d742ee20b815d88e17e54db4a2a7a3b30324e3.tgz", - "integrity": "sha512-xR6rt+z5LnNqTP5BBc+8+ySgf4WNMimOKXRn6xfNRDSpHvbOEmd7+qAOmzCrddEc4Cp8nFC0txU14dstjH7FXA==", - "license": "Apache-2.0" + "integrity": "sha512-xR6rt+z5LnNqTP5BBc+8+ySgf4WNMimOKXRn6xfNRDSpHvbOEmd7+qAOmzCrddEc4Cp8nFC0txU14dstjH7FXA==" }, "node_modules/@prisma/fetch-engine": { "version": "5.19.1", "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.19.1.tgz", "integrity": "sha512-pCq74rtlOVJfn4pLmdJj+eI4P7w2dugOnnTXpRilP/6n5b2aZiA4ulJlE0ddCbTPkfHmOL9BfaRgA8o+1rfdHw==", - "license": "Apache-2.0", "dependencies": { "@prisma/debug": "5.19.1", "@prisma/engines-version": "5.19.1-2.69d742ee20b815d88e17e54db4a2a7a3b30324e3", @@ -2116,23 +1285,22 @@ "version": "5.19.1", "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.19.1.tgz", "integrity": "sha512-sCeoJ+7yt0UjnR+AXZL7vXlg5eNxaFOwC23h0KvW1YIXUoa7+W2ZcAUhoEQBmJTW4GrFqCuZ8YSP0mkDa4k3Zg==", - "license": "Apache-2.0", "dependencies": { "@prisma/debug": "5.19.1" } }, "node_modules/@remix-run/router": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz", - "integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==", + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.21.0.tgz", + "integrity": "sha512-xfSkCAchbdG5PnbrKqFWwia4Bi61nH+wm8wLEqfHDyp7Y3dZzgqS2itV8i4gAq9pC2HsTpwyBC6Ds8VHZ96JlA==", "engines": { "node": ">=14.0.0" } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.10.0.tgz", - "integrity": "sha512-/MeDQmcD96nVoRumKUljsYOLqfv1YFJps+0pTrb2Z9Nl/w5qNUysMaWQsrd1mvAlNT4yza1iVyIu4Q4AgF6V3A==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.30.1.tgz", + "integrity": "sha512-pSWY+EVt3rJ9fQ3IqlrEUtXh3cGqGtPDH1FQlNZehO2yYxCHEX1SPsz1M//NXwYfbTlcKr9WObLnJX9FsS9K1Q==", "cpu": [ "arm" ], @@ -2142,9 +1310,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.10.0.tgz", - "integrity": "sha512-lvu0jK97mZDJdpZKDnZI93I0Om8lSDaiPx3OiCk0RXn3E8CMPJNS/wxjAvSJJzhhZpfjXsjLWL8LnS6qET4VNQ==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.30.1.tgz", + "integrity": "sha512-/NA2qXxE3D/BRjOJM8wQblmArQq1YoBVJjrjoTSBS09jgUisq7bqxNHJ8kjCHeV21W/9WDGwJEWSN0KQ2mtD/w==", "cpu": [ "arm64" ], @@ -2154,9 +1322,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.10.0.tgz", - "integrity": "sha512-uFpayx8I8tyOvDkD7X6n0PriDRWxcqEjqgtlxnUA/G9oS93ur9aZ8c8BEpzFmsed1TH5WZNG5IONB8IiW90TQg==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.30.1.tgz", + "integrity": "sha512-r7FQIXD7gB0WJ5mokTUgUWPl0eYIH0wnxqeSAhuIwvnnpjdVB8cRRClyKLQr7lgzjctkbp5KmswWszlwYln03Q==", "cpu": [ "arm64" ], @@ -2166,9 +1334,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.10.0.tgz", - "integrity": "sha512-nIdCX03qFKoR/MwQegQBK+qZoSpO3LESurVAC6s6jazLA1Mpmgzo3Nj3H1vydXp/JM29bkCiuF7tDuToj4+U9Q==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.30.1.tgz", + "integrity": "sha512-x78BavIwSH6sqfP2xeI1hd1GpHL8J4W2BXcVM/5KYKoAD3nNsfitQhvWSw+TFtQTLZ9OmlF+FEInEHyubut2OA==", "cpu": [ "x64" ], @@ -2177,10 +1345,46 @@ "darwin" ] }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.30.1.tgz", + "integrity": "sha512-HYTlUAjbO1z8ywxsDFWADfTRfTIIy/oUlfIDmlHYmjUP2QRDTzBuWXc9O4CXM+bo9qfiCclmHk1x4ogBjOUpUQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.30.1.tgz", + "integrity": "sha512-1MEdGqogQLccphhX5myCJqeGNYTNcmTyaic9S7CG3JhwuIByJ7J05vGbZxsizQthP1xpVx7kd3o31eOogfEirw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ] + }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.10.0.tgz", - "integrity": "sha512-Fz7a+y5sYhYZMQFRkOyCs4PLhICAnxRX/GnWYReaAoruUzuRtcf+Qnw+T0CoAWbHCuz2gBUwmWnUgQ67fb3FYw==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.30.1.tgz", + "integrity": "sha512-PaMRNBSqCx7K3Wc9QZkFx5+CX27WFpAMxJNiYGAXfmMIKC7jstlr32UhTgK6T07OtqR+wYlWm9IxzennjnvdJg==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.30.1.tgz", + "integrity": "sha512-B8Rcyj9AV7ZlEFqvB5BubG5iO6ANDsRKlhIxySXcF1axXYUyqwBok+XZPgIYGBgs7LDXfWfifxhw0Ik57T0Yug==", "cpu": [ "arm" ], @@ -2190,9 +1394,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.10.0.tgz", - "integrity": "sha512-yPtF9jIix88orwfTi0lJiqINnlWo6p93MtZEoaehZnmCzEmLL0eqjA3eGVeyQhMtxdV+Mlsgfwhh0+M/k1/V7Q==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.30.1.tgz", + "integrity": "sha512-hqVyueGxAj3cBKrAI4aFHLV+h0Lv5VgWZs9CUGqr1z0fZtlADVV1YPOij6AhcK5An33EXaxnDLmJdQikcn5NEw==", "cpu": [ "arm64" ], @@ -2202,9 +1406,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.10.0.tgz", - "integrity": "sha512-9GW9yA30ib+vfFiwjX+N7PnjTnCMiUffhWj4vkG4ukYv1kJ4T9gHNg8zw+ChsOccM27G9yXrEtMScf1LaCuoWQ==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.30.1.tgz", + "integrity": "sha512-i4Ab2vnvS1AE1PyOIGp2kXni69gU2DAUVt6FSXeIqUCPIR3ZlheMW3oP2JkukDfu3PsexYRbOiJrY+yVNSk9oA==", "cpu": [ "arm64" ], @@ -2213,10 +1417,34 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.30.1.tgz", + "integrity": "sha512-fARcF5g296snX0oLGkVxPmysetwUk2zmHcca+e9ObOovBR++9ZPOhqFUM61UUZ2EYpXVPN1redgqVoBB34nTpQ==", + "cpu": [ + "loong64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.30.1.tgz", + "integrity": "sha512-GLrZraoO3wVT4uFXh67ElpwQY0DIygxdv0BNW9Hkm3X34wu+BkqrDrkcsIapAY+N2ATEbvak0XQ9gxZtCIA5Rw==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.10.0.tgz", - "integrity": "sha512-X1ES+V4bMq2ws5fF4zHornxebNxMXye0ZZjUrzOrf7UMx1d6wMQtfcchZ8SqUnQPPHdOyOLW6fTcUiFgHFadRA==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.30.1.tgz", + "integrity": "sha512-0WKLaAUUHKBtll0wvOmh6yh3S0wSU9+yas923JIChfxOaaBarmb/lBKPF0w/+jTVozFnOXJeRGZ8NvOxvk/jcw==", "cpu": [ "riscv64" ], @@ -2225,10 +1453,22 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.30.1.tgz", + "integrity": "sha512-GWFs97Ruxo5Bt+cvVTQkOJ6TIx0xJDD/bMAOXWJg8TCSTEK8RnFeOeiFTxKniTc4vMIaWvCplMAFBt9miGxgkA==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.10.0.tgz", - "integrity": "sha512-w/5OpT2EnI/Xvypw4FIhV34jmNqU5PZjZue2l2Y3ty1Ootm3SqhI+AmfhlUYGBTd9JnpneZCDnt3uNOiOBkMyw==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.30.1.tgz", + "integrity": "sha512-UtgGb7QGgXDIO+tqqJ5oZRGHsDLO8SlpE4MhqpY9Llpzi5rJMvrK6ZGhsRCST2abZdBqIBeXW6WPD5fGK5SDwg==", "cpu": [ "x64" ], @@ -2238,9 +1478,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.10.0.tgz", - "integrity": "sha512-q/meftEe3QlwQiGYxD9rWwB21DoKQ9Q8wA40of/of6yGHhZuGfZO0c3WYkN9dNlopHlNT3mf5BPsUSxoPuVQaw==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.30.1.tgz", + "integrity": "sha512-V9U8Ey2UqmQsBT+xTOeMzPzwDzyXmnAoO4edZhL7INkwQcaW1Ckv3WJX3qrrp/VHaDkEWIBWhRwP47r8cdrOow==", "cpu": [ "x64" ], @@ -2250,9 +1490,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.10.0.tgz", - "integrity": "sha512-NrR6667wlUfP0BHaEIKgYM/2va+Oj+RjZSASbBMnszM9k+1AmliRjHc3lJIiOehtSSjqYiO7R6KLNrWOX+YNSQ==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.30.1.tgz", + "integrity": "sha512-WabtHWiPaFF47W3PkHnjbmWawnX/aE57K47ZDT1BXTS5GgrBUEpvOzq0FI0V/UYzQJgdb8XlhVNH8/fwV8xDjw==", "cpu": [ "arm64" ], @@ -2262,9 +1502,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.10.0.tgz", - "integrity": "sha512-FV0Tpt84LPYDduIDcXvEC7HKtyXxdvhdAOvOeWMWbQNulxViH2O07QXkT/FffX4FqEI02jEbCJbr+YcuKdyyMg==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.30.1.tgz", + "integrity": "sha512-pxHAU+Zv39hLUTdQQHUVHf4P+0C47y/ZloorHpzs2SXMRqeAWmGghzAhfOlzFHHwjvgokdFAhC4V+6kC1lRRfw==", "cpu": [ "ia32" ], @@ -2274,9 +1514,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.10.0.tgz", - "integrity": "sha512-OZoJd+o5TaTSQeFFQ6WjFCiltiYVjIdsXxwu/XZ8qRpsvMQr4UsVrE5UyT9RIvsnuF47DqkJKhhVZ2Q9YW9IpQ==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.30.1.tgz", + "integrity": "sha512-D6qjsXGcvhTjv0kI4fU8tUuBDF/Ueee4SVX79VfNDXZa64TfCW1Slkb6Z7O1p7vflqZjcmOVdZlqf8gvJxc6og==", "cpu": [ "x64" ], @@ -2299,20 +1539,20 @@ } }, "node_modules/@tailwindcss/forms": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.7.tgz", - "integrity": "sha512-QE7X69iQI+ZXwldE+rzasvbJiyV/ju1FGHH0Qn2W3FKbuYtqp8LKcy6iSw79fVUT5/Vvf+0XgLCeYVG+UV6hOw==", + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.10.tgz", + "integrity": "sha512-utI1ONF6uf/pPNO68kmN1b8rEwNXv3czukalo8VtJH8ksIkZXr3Q3VYudZLkCsDd4Wku120uF02hYK25XGPorw==", "dependencies": { "mini-svg-data-uri": "^1.2.3" }, "peerDependencies": { - "tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1" + "tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1 || >= 4.0.0-alpha.20 || >= 4.0.0-beta.1" } }, "node_modules/@tailwindcss/typography": { - "version": "0.5.10", - "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.10.tgz", - "integrity": "sha512-Pe8BuPJQJd3FfRnm6H0ulKIGoMEQS+Vq01R6M5aCrFB/ccR/shT+0kXLjouGC1gFLm9hopTFN+DMP0pfwRWzPw==", + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.16.tgz", + "integrity": "sha512-0wDLwCVF5V3x3b1SGXPCDcdsbDHMBe+lkFzBRaHeLvNi+nrrnZ1lA18u+OTWO8iSWU2GxUOCvlXtDuqftc1oiA==", "dependencies": { "lodash.castarray": "^4.4.0", "lodash.isplainobject": "^4.0.6", @@ -2320,7 +1560,7 @@ "postcss-selector-parser": "6.0.10" }, "peerDependencies": { - "tailwindcss": ">=3.0.0 || insiders" + "tailwindcss": ">=3.0.0 || insiders || >=4.0.0-alpha.20 || >=4.0.0-beta.1" } }, "node_modules/@tanstack/query-core": { @@ -2419,53 +1659,28 @@ "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==" }, "node_modules/@testing-library/jest-dom": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.4.2.tgz", - "integrity": "sha512-CzqH0AFymEMG48CpzXFriYYkOjk6ZGPCLMhW9e9jg3KMCn5OfJecF8GtGW7yGfR/IgCe3SX8BSwjdzI6BBbZLw==", + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.6.3.tgz", + "integrity": "sha512-IteBhl4XqYNkM54f4ejhLRJiZNqcSCoXUOG2CPK7qbD322KjQozM4kHQOfkG2oln9b9HTYqs+Sae8vBATubxxA==", "dependencies": { - "@adobe/css-tools": "^4.3.2", - "@babel/runtime": "^7.9.2", + "@adobe/css-tools": "^4.4.0", "aria-query": "^5.0.0", "chalk": "^3.0.0", "css.escape": "^1.5.1", "dom-accessibility-api": "^0.6.3", - "lodash": "^4.17.15", + "lodash": "^4.17.21", "redent": "^3.0.0" }, "engines": { "node": ">=14", "npm": ">=6", "yarn": ">=1" - }, - "peerDependencies": { - "@jest/globals": ">= 28", - "@types/bun": "latest", - "@types/jest": ">= 28", - "jest": ">= 28", - "vitest": ">= 0.32" - }, - "peerDependenciesMeta": { - "@jest/globals": { - "optional": true - }, - "@types/bun": { - "optional": true - }, - "@types/jest": { - "optional": true - }, - "jest": { - "optional": true - }, - "vitest": { - "optional": true - } } }, "node_modules/@testing-library/react": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.2.1.tgz", - "integrity": "sha512-sGdjws32ai5TLerhvzThYFbpnF9XtL65Cjf+gB0Dhr29BGqK+mAeN7SURSdu+eqgET4ANcWoC7FQpkaiGvBr+A==", + "version": "14.3.1", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-14.3.1.tgz", + "integrity": "sha512-H99XjUhWQw0lTgyMN05W3xQG1Nh4lq574D8keFf1dDoNTJgp66VbJozRaczoF+wsiaPJNt/TcnfpLGufGxSrZQ==", "dependencies": { "@babel/runtime": "^7.12.5", "@testing-library/dom": "^9.0.0", @@ -2488,15 +1703,15 @@ } }, "node_modules/@tsconfig/node18": { - "version": "18.2.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node18/-/node18-18.2.2.tgz", - "integrity": "sha512-d6McJeGsuoRlwWZmVIeE8CUA27lu6jLjvv1JzqmpsytOYYbVi1tHZEnwCNVOXnj4pyLvneZlFlpXUK+X9wBWyw==", + "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/@tybys/wasm-util": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.8.1.tgz", - "integrity": "sha512-GSsTwyBl4pIzsxAY5wroZdyQKyhXk0d8PCRZtrSZ2WEB1cBdrp2EgGBwHOGCZtIIPun/DL3+AykCv+J6fyRH4Q==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.9.0.tgz", + "integrity": "sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==", "optional": true, "dependencies": { "tslib": "^2.4.0" @@ -2549,9 +1764,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==" }, "node_modules/@types/express": { "version": "4.17.21", @@ -2566,9 +1781,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.43", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", - "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", + "version": "4.19.6", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz", + "integrity": "sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==", "dev": true, "dependencies": { "@types/node": "*", @@ -2600,22 +1815,22 @@ "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" }, "node_modules/@types/node": { - "version": "20.11.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.17.tgz", - "integrity": "sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw==", + "version": "22.10.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.6.tgz", + "integrity": "sha512-qNiuwC4ZDAUNcY47xgaSuS92cjf8JbSUoaKS77bmLG1rU7MlATVSiw/IlrjtIyyskXBZ8KkNfjK/P5na7rgXbQ==", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.20.0" } }, "node_modules/@types/prop-types": { - "version": "15.7.11", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz", - "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==" + "version": "15.7.14", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.14.tgz", + "integrity": "sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==" }, "node_modules/@types/qs": { - "version": "6.9.11", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz", - "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==", + "version": "6.9.18", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.18.tgz", + "integrity": "sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==", "dev": true }, "node_modules/@types/range-parser": { @@ -2625,28 +1840,22 @@ "dev": true }, "node_modules/@types/react": { - "version": "18.2.55", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.55.tgz", - "integrity": "sha512-Y2Tz5P4yz23brwm2d7jNon39qoAtMMmalOQv6+fEFt1mT+FcM3D841wDpoUvFXhaYenuROCy3FZYqdTjM7qVyA==", + "version": "18.3.18", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.18.tgz", + "integrity": "sha512-t4yC+vtgnkYjNSKlFx1jkAhH8LgTo2N/7Qvi83kdEaUtMDiwpbLAktKDaAMlRcJ5eSxZkH74eEGt1ky31d7kfQ==", "dependencies": { "@types/prop-types": "*", - "@types/scheduler": "*", "csstype": "^3.0.2" } }, "node_modules/@types/react-dom": { - "version": "18.2.19", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.19.tgz", - "integrity": "sha512-aZvQL6uUbIJpjZk4U8JZGbau9KDeAwMfmhyWorxgBkqDIEf6ROjRozcmPIicqsUwPUjbkDfHKgGee1Lq65APcA==", - "dependencies": { - "@types/react": "*" + "version": "18.3.5", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.5.tgz", + "integrity": "sha512-P4t6saawp+b/dFrUr2cvkVsfvPguwsxtH6dNIYRllMsefqFzkZk5UIjzyDOv5g1dXIPdG4Sp1yCR4Z6RCUsG/Q==", + "peerDependencies": { + "@types/react": "^18.0.0" } }, - "node_modules/@types/scheduler": { - "version": "0.16.8", - "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", - "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==" - }, "node_modules/@types/send": { "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", @@ -2658,31 +1867,31 @@ } }, "node_modules/@types/serve-static": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.5.tgz", - "integrity": "sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==", + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", + "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", "dev": true, "dependencies": { "@types/http-errors": "*", - "@types/mime": "*", - "@types/node": "*" + "@types/node": "*", + "@types/send": "*" } }, "node_modules/@types/set-cookie-parser": { - "version": "2.4.7", - "resolved": "https://registry.npmjs.org/@types/set-cookie-parser/-/set-cookie-parser-2.4.7.tgz", - "integrity": "sha512-+ge/loa0oTozxip6zmhRIk8Z/boU51wl9Q6QdLZcokIGMzY5lFXYy/x7Htj2HTC6/KZP1hUbZ1ekx8DYXICvWg==", + "version": "2.4.10", + "resolved": "https://registry.npmjs.org/@types/set-cookie-parser/-/set-cookie-parser-2.4.10.tgz", + "integrity": "sha512-GGmQVGpQWUe5qglJozEjZV/5dyxbOOZ0LHe/lqyWssB88Y4svNfst0uqBVscdDeIKl5Jy5+aPSvy7mI9tYRguw==", "dependencies": { "@types/node": "*" } }, "node_modules/@vitest/expect": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.2.2.tgz", - "integrity": "sha512-3jpcdPAD7LwHUUiT2pZTj2U82I2Tcgg2oVPvKxhn6mDI2On6tfvPQTjAI4628GUGDZrCm4Zna9iQHm5cEexOAg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", + "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", "dependencies": { - "@vitest/spy": "1.2.2", - "@vitest/utils": "1.2.2", + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", "chai": "^4.3.10" }, "funding": { @@ -2690,11 +1899,11 @@ } }, "node_modules/@vitest/runner": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.2.2.tgz", - "integrity": "sha512-JctG7QZ4LSDXr5CsUweFgcpEvrcxOV1Gft7uHrvkQ+fsAVylmWQvnaAr/HDp3LAH1fztGMQZugIheTWjaGzYIg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", + "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", "dependencies": { - "@vitest/utils": "1.2.2", + "@vitest/utils": "1.6.0", "p-limit": "^5.0.0", "pathe": "^1.1.1" }, @@ -2703,9 +1912,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.2.2.tgz", - "integrity": "sha512-SmGY4saEw1+bwE1th6S/cZmPxz/Q4JWsl7LvbQIky2tKE35US4gd0Mjzqfr84/4OD0tikGWaWdMja/nWL5NIPA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", + "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", "dependencies": { "magic-string": "^0.30.5", "pathe": "^1.1.1", @@ -2740,14 +1949,14 @@ } }, "node_modules/@vitest/snapshot/node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==" }, "node_modules/@vitest/spy": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.2.2.tgz", - "integrity": "sha512-k9Gcahssw8d7X3pSLq3e3XEu/0L78mUkCjivUqCQeXJm9clfXR/Td8+AP+VC1O6fKPIDLcHDTAmBOINVuv6+7g==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", + "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", "dependencies": { "tinyspy": "^2.2.0" }, @@ -2756,11 +1965,11 @@ } }, "node_modules/@vitest/ui": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-1.2.2.tgz", - "integrity": "sha512-CG+5fa8lyoBr+9i+UZGS31Qw81v33QlD10uecHxN2CLJVN+jLnqx4pGzGvFFeJ7jSnUCT0AlbmVWY6fU6NJZmw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-1.6.0.tgz", + "integrity": "sha512-k3Lyo+ONLOgylctiGovRKy7V4+dIN2yxstX3eY5cWFXH6WP+ooVX79YSyi0GagdTQzLmT43BF27T0s6dOIPBXA==", "dependencies": { - "@vitest/utils": "1.2.2", + "@vitest/utils": "1.6.0", "fast-glob": "^3.3.2", "fflate": "^0.8.1", "flatted": "^3.2.9", @@ -2772,13 +1981,13 @@ "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "vitest": "^1.0.0" + "vitest": "1.6.0" } }, "node_modules/@vitest/utils": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.2.2.tgz", - "integrity": "sha512-WKITBHLsBHlpjnDQahr+XK6RE7MiAsgrIkr0pGhQ9ygoxBfUeG0lUG5iLlzqjmKSlBv3+j5EGsriBzh+C3Tq9g==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", + "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", "dependencies": { "diff-sequences": "^29.6.3", "estree-walker": "^3.0.3", @@ -2814,9 +2023,9 @@ } }, "node_modules/@vitest/utils/node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==" }, "node_modules/@xmldom/xmldom": { "version": "0.8.10", @@ -2851,9 +2060,9 @@ } }, "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "bin": { "acorn": "bin/acorn" }, @@ -2871,9 +2080,12 @@ } }, "node_modules/acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "dependencies": { + "acorn": "^8.11.0" + }, "engines": { "node": ">=0.4.0" } @@ -2890,11 +2102,11 @@ } }, "node_modules/agent-base/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -2906,9 +2118,9 @@ } }, "node_modules/agent-base/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/aggregate-error": { "version": "3.1.0", @@ -2948,9 +2160,9 @@ } }, "node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "engines": { "node": ">=12" }, @@ -2990,16 +2202,32 @@ "version": "1.9.2", "resolved": "https://registry.npmjs.org/arctic/-/arctic-1.9.2.tgz", "integrity": "sha512-VTnGpYx+ypboJdNrWnK17WeD7zN/xSCHnpecd5QYsBfVZde/5i+7DJ1wrf/ioSDMiEjagXmyNWAE3V2C9f1hNg==", - "license": "MIT", "dependencies": { "oslo": "1.2.0" } }, + "node_modules/arctic/node_modules/@emnapi/core": { + "version": "0.45.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-0.45.0.tgz", + "integrity": "sha512-DPWjcUDQkCeEM4VnljEOEcXdAD7pp8zSZsgOujk/LGIwCXWbXJngin+MO4zbH429lzeC3WbYLGjE2MaUOwzpyw==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/arctic/node_modules/@emnapi/runtime": { + "version": "0.45.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-0.45.0.tgz", + "integrity": "sha512-Txumi3td7J4A/xTTwlssKieHKTGl3j4A1tglBx72auZ49YK7ePY6XZricgIg9mnZT4xPfA+UPCUdnhRuEFDL+w==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/arctic/node_modules/@node-rs/argon2": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/@node-rs/argon2/-/argon2-1.7.0.tgz", "integrity": "sha512-zfULc+/tmcWcxn+nHkbyY8vP3+MpEqKORbszt4UkpqZgBgDAAIYvuDN/zukfTgdmo6tmJKKVfzigZOPk4LlIog==", - "license": "MIT", "engines": { "node": ">= 10" }, @@ -3027,7 +2255,6 @@ "cpu": [ "arm" ], - "license": "MIT", "optional": true, "os": [ "android" @@ -3043,7 +2270,6 @@ "cpu": [ "arm64" ], - "license": "MIT", "optional": true, "os": [ "android" @@ -3059,7 +2285,6 @@ "cpu": [ "arm64" ], - "license": "MIT", "optional": true, "os": [ "darwin" @@ -3075,7 +2300,6 @@ "cpu": [ "x64" ], - "license": "MIT", "optional": true, "os": [ "darwin" @@ -3091,7 +2315,6 @@ "cpu": [ "x64" ], - "license": "MIT", "optional": true, "os": [ "freebsd" @@ -3107,7 +2330,6 @@ "cpu": [ "arm" ], - "license": "MIT", "optional": true, "os": [ "linux" @@ -3123,7 +2345,6 @@ "cpu": [ "arm64" ], - "license": "MIT", "optional": true, "os": [ "linux" @@ -3135,267 +2356,10 @@ "node_modules/arctic/node_modules/@node-rs/argon2-linux-arm64-musl": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-arm64-musl/-/argon2-linux-arm64-musl-1.7.0.tgz", - "integrity": "sha512-BKWS8iVconhE3jrb9mj6t1J9vwUqQPpzCbUKxfTGJfc+kNL58F1SXHBoe2cDYGnHrFEHTY0YochzXoAfm4Dm/A==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/arctic/node_modules/@node-rs/argon2-linux-x64-gnu": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-x64-gnu/-/argon2-linux-x64-gnu-1.7.0.tgz", - "integrity": "sha512-EmgqZOlf4Jurk/szW1iTsVISx25bKksVC5uttJDUloTgsAgIGReCpUUO1R24pBhu9ESJa47iv8NSf3yAfGv6jQ==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/arctic/node_modules/@node-rs/argon2-linux-x64-musl": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-x64-musl/-/argon2-linux-x64-musl-1.7.0.tgz", - "integrity": "sha512-/o1efYCYIxjfuoRYyBTi2Iy+1iFfhqHCvvVsnjNSgO1xWiWrX0Rrt/xXW5Zsl7vS2Y+yu8PL8KFWRzZhaVxfKA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/arctic/node_modules/@node-rs/argon2-wasm32-wasi": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-wasm32-wasi/-/argon2-wasm32-wasi-1.7.0.tgz", - "integrity": "sha512-Evmk9VcxqnuwQftfAfYEr6YZYSPLzmKUsbFIMep5nTt9PT4XYRFAERj7wNYp+rOcBenF3X4xoB+LhwcOMTNE5w==", - "cpu": [ - "wasm32" - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/core": "^0.45.0", - "@emnapi/runtime": "^0.45.0", - "@tybys/wasm-util": "^0.8.1", - "memfs-browser": "^3.4.13000" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/arctic/node_modules/@node-rs/argon2-win32-arm64-msvc": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-arm64-msvc/-/argon2-win32-arm64-msvc-1.7.0.tgz", - "integrity": "sha512-qgsU7T004COWWpSA0tppDqDxbPLgg8FaU09krIJ7FBl71Sz8SFO40h7fDIjfbTT5w7u6mcaINMQ5bSHu75PCaA==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/arctic/node_modules/@node-rs/argon2-win32-ia32-msvc": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-ia32-msvc/-/argon2-win32-ia32-msvc-1.7.0.tgz", - "integrity": "sha512-JGafwWYQ/HpZ3XSwP4adQ6W41pRvhcdXvpzIWtKvX+17+xEXAe2nmGWM6s27pVkg1iV2ZtoYLRDkOUoGqZkCcg==", - "cpu": [ - "ia32" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/arctic/node_modules/@node-rs/argon2-win32-x64-msvc": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-x64-msvc/-/argon2-win32-x64-msvc-1.7.0.tgz", - "integrity": "sha512-9oq4ShyFakw8AG3mRls0AoCpxBFcimYx7+jvXeAf2OqKNO+mSA6eZ9z7KQeVCi0+SOEUYxMGf5UiGiDb9R6+9Q==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/arctic/node_modules/@node-rs/bcrypt": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt/-/bcrypt-1.9.0.tgz", - "integrity": "sha512-u2OlIxW264bFUfvbFqDz9HZKFjwe8FHFtn7T/U8mYjPZ7DWYpbUB+/dkW/QgYfMSfR0ejkyuWaBBe0coW7/7ig==", - "license": "MIT", - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - }, - "optionalDependencies": { - "@node-rs/bcrypt-android-arm-eabi": "1.9.0", - "@node-rs/bcrypt-android-arm64": "1.9.0", - "@node-rs/bcrypt-darwin-arm64": "1.9.0", - "@node-rs/bcrypt-darwin-x64": "1.9.0", - "@node-rs/bcrypt-freebsd-x64": "1.9.0", - "@node-rs/bcrypt-linux-arm-gnueabihf": "1.9.0", - "@node-rs/bcrypt-linux-arm64-gnu": "1.9.0", - "@node-rs/bcrypt-linux-arm64-musl": "1.9.0", - "@node-rs/bcrypt-linux-x64-gnu": "1.9.0", - "@node-rs/bcrypt-linux-x64-musl": "1.9.0", - "@node-rs/bcrypt-wasm32-wasi": "1.9.0", - "@node-rs/bcrypt-win32-arm64-msvc": "1.9.0", - "@node-rs/bcrypt-win32-ia32-msvc": "1.9.0", - "@node-rs/bcrypt-win32-x64-msvc": "1.9.0" - } - }, - "node_modules/arctic/node_modules/@node-rs/bcrypt-android-arm-eabi": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-android-arm-eabi/-/bcrypt-android-arm-eabi-1.9.0.tgz", - "integrity": "sha512-nOCFISGtnodGHNiLrG0WYLWr81qQzZKYfmwHc7muUeq+KY0sQXyHOwZk9OuNQAWv/lnntmtbwkwT0QNEmOyLvA==", - "cpu": [ - "arm" - ], - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/arctic/node_modules/@node-rs/bcrypt-android-arm64": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-android-arm64/-/bcrypt-android-arm64-1.9.0.tgz", - "integrity": "sha512-+ZrIAtigVmjYkqZQTThHVlz0+TG6D+GDHWhVKvR2DifjtqJ0i+mb9gjo++hN+fWEQdWNGxKCiBBjwgT4EcXd6A==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/arctic/node_modules/@node-rs/bcrypt-darwin-arm64": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-darwin-arm64/-/bcrypt-darwin-arm64-1.9.0.tgz", - "integrity": "sha512-CQiS+F9Pa0XozvkXR1g7uXE9QvBOPOplDg0iCCPRYTN9PqA5qYxhwe48G3o+v2UeQceNRrbnEtWuANm7JRqIhw==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/arctic/node_modules/@node-rs/bcrypt-darwin-x64": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-darwin-x64/-/bcrypt-darwin-x64-1.9.0.tgz", - "integrity": "sha512-4pTKGawYd7sNEjdJ7R/R67uwQH1VvwPZ0SSUMmeNHbxD5QlwAPXdDH11q22uzVXsvNFZ6nGQBg8No5OUGpx6Ug==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/arctic/node_modules/@node-rs/bcrypt-freebsd-x64": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-freebsd-x64/-/bcrypt-freebsd-x64-1.9.0.tgz", - "integrity": "sha512-UmWzySX4BJhT/B8xmTru6iFif3h0Rpx3TqxRLCcbgmH43r7k5/9QuhpiyzpvKGpKHJCFNm4F3rC2wghvw5FCIg==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/arctic/node_modules/@node-rs/bcrypt-linux-arm-gnueabihf": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-arm-gnueabihf/-/bcrypt-linux-arm-gnueabihf-1.9.0.tgz", - "integrity": "sha512-8qoX4PgBND2cVwsbajoAWo3NwdfJPEXgpCsZQZURz42oMjbGyhhSYbovBCskGU3EBLoC8RA2B1jFWooeYVn5BA==", - "cpu": [ - "arm" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/arctic/node_modules/@node-rs/bcrypt-linux-arm64-gnu": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-arm64-gnu/-/bcrypt-linux-arm64-gnu-1.9.0.tgz", - "integrity": "sha512-TuAC6kx0SbcIA4mSEWPi+OCcDjTQUMl213v5gMNlttF+D4ieIZx6pPDGTaMO6M2PDHTeCG0CBzZl0Lu+9b0c7Q==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/arctic/node_modules/@node-rs/bcrypt-linux-arm64-musl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-arm64-musl/-/bcrypt-linux-arm64-musl-1.9.0.tgz", - "integrity": "sha512-/sIvKDABOI8QOEnLD7hIj02BVaNOuCIWBKvxcJOt8+TuwJ6zmY1UI5kSv9d99WbiHjTp97wtAUbZQwauU4b9ew==", + "integrity": "sha512-BKWS8iVconhE3jrb9mj6t1J9vwUqQPpzCbUKxfTGJfc+kNL58F1SXHBoe2cDYGnHrFEHTY0YochzXoAfm4Dm/A==", "cpu": [ "arm64" ], - "license": "MIT", "optional": true, "os": [ "linux" @@ -3404,14 +2368,13 @@ "node": ">= 10" } }, - "node_modules/arctic/node_modules/@node-rs/bcrypt-linux-x64-gnu": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-x64-gnu/-/bcrypt-linux-x64-gnu-1.9.0.tgz", - "integrity": "sha512-DyyhDHDsLBsCKz1tZ1hLvUZSc1DK0FU0v52jK6IBQxrj24WscSU9zZe7ie/V9kdmA4Ep57BfpWX8Dsa2JxGdgQ==", + "node_modules/arctic/node_modules/@node-rs/argon2-linux-x64-gnu": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-x64-gnu/-/argon2-linux-x64-gnu-1.7.0.tgz", + "integrity": "sha512-EmgqZOlf4Jurk/szW1iTsVISx25bKksVC5uttJDUloTgsAgIGReCpUUO1R24pBhu9ESJa47iv8NSf3yAfGv6jQ==", "cpu": [ "x64" ], - "license": "MIT", "optional": true, "os": [ "linux" @@ -3420,14 +2383,13 @@ "node": ">= 10" } }, - "node_modules/arctic/node_modules/@node-rs/bcrypt-linux-x64-musl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-linux-x64-musl/-/bcrypt-linux-x64-musl-1.9.0.tgz", - "integrity": "sha512-duIiuqQ+Lew8ASSAYm6ZRqcmfBGWwsi81XLUwz86a2HR7Qv6V4yc3ZAUQovAikhjCsIqe8C11JlAZSK6+PlXYg==", + "node_modules/arctic/node_modules/@node-rs/argon2-linux-x64-musl": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-x64-musl/-/argon2-linux-x64-musl-1.7.0.tgz", + "integrity": "sha512-/o1efYCYIxjfuoRYyBTi2Iy+1iFfhqHCvvVsnjNSgO1xWiWrX0Rrt/xXW5Zsl7vS2Y+yu8PL8KFWRzZhaVxfKA==", "cpu": [ "x64" ], - "license": "MIT", "optional": true, "os": [ "linux" @@ -3436,14 +2398,13 @@ "node": ">= 10" } }, - "node_modules/arctic/node_modules/@node-rs/bcrypt-wasm32-wasi": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-wasm32-wasi/-/bcrypt-wasm32-wasi-1.9.0.tgz", - "integrity": "sha512-ylaGmn9Wjwv/D5lxtawttx3H6Uu2WTTR7lWlRHGT6Ga/MB1Vj4OjSGUW8G8zIVnKuXpGbZ92pgHlt4HUpSLctw==", + "node_modules/arctic/node_modules/@node-rs/argon2-wasm32-wasi": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-wasm32-wasi/-/argon2-wasm32-wasi-1.7.0.tgz", + "integrity": "sha512-Evmk9VcxqnuwQftfAfYEr6YZYSPLzmKUsbFIMep5nTt9PT4XYRFAERj7wNYp+rOcBenF3X4xoB+LhwcOMTNE5w==", "cpu": [ "wasm32" ], - "license": "MIT", "optional": true, "dependencies": { "@emnapi/core": "^0.45.0", @@ -3455,14 +2416,13 @@ "node": ">=14.0.0" } }, - "node_modules/arctic/node_modules/@node-rs/bcrypt-win32-arm64-msvc": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-win32-arm64-msvc/-/bcrypt-win32-arm64-msvc-1.9.0.tgz", - "integrity": "sha512-2h86gF7QFyEzODuDFml/Dp1MSJoZjxJ4yyT2Erf4NkwsiA5MqowUhUsorRwZhX6+2CtlGa7orbwi13AKMsYndw==", + "node_modules/arctic/node_modules/@node-rs/argon2-win32-arm64-msvc": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-arm64-msvc/-/argon2-win32-arm64-msvc-1.7.0.tgz", + "integrity": "sha512-qgsU7T004COWWpSA0tppDqDxbPLgg8FaU09krIJ7FBl71Sz8SFO40h7fDIjfbTT5w7u6mcaINMQ5bSHu75PCaA==", "cpu": [ "arm64" ], - "license": "MIT", "optional": true, "os": [ "win32" @@ -3471,14 +2431,13 @@ "node": ">= 10" } }, - "node_modules/arctic/node_modules/@node-rs/bcrypt-win32-ia32-msvc": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-win32-ia32-msvc/-/bcrypt-win32-ia32-msvc-1.9.0.tgz", - "integrity": "sha512-kqxalCvhs4FkN0+gWWfa4Bdy2NQAkfiqq/CEf6mNXC13RSV673Ev9V8sRlQyNpCHCNkeXfOT9pgoBdJmMs9muA==", + "node_modules/arctic/node_modules/@node-rs/argon2-win32-ia32-msvc": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-ia32-msvc/-/argon2-win32-ia32-msvc-1.7.0.tgz", + "integrity": "sha512-JGafwWYQ/HpZ3XSwP4adQ6W41pRvhcdXvpzIWtKvX+17+xEXAe2nmGWM6s27pVkg1iV2ZtoYLRDkOUoGqZkCcg==", "cpu": [ "ia32" ], - "license": "MIT", "optional": true, "os": [ "win32" @@ -3487,14 +2446,13 @@ "node": ">= 10" } }, - "node_modules/arctic/node_modules/@node-rs/bcrypt-win32-x64-msvc": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@node-rs/bcrypt-win32-x64-msvc/-/bcrypt-win32-x64-msvc-1.9.0.tgz", - "integrity": "sha512-2y0Tuo6ZAT2Cz8V7DHulSlv1Bip3zbzeXyeur+uR25IRNYXKvI/P99Zl85Fbuu/zzYAZRLLlGTRe6/9IHofe/w==", + "node_modules/arctic/node_modules/@node-rs/argon2-win32-x64-msvc": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-x64-msvc/-/argon2-win32-x64-msvc-1.7.0.tgz", + "integrity": "sha512-9oq4ShyFakw8AG3mRls0AoCpxBFcimYx7+jvXeAf2OqKNO+mSA6eZ9z7KQeVCi0+SOEUYxMGf5UiGiDb9R6+9Q==", "cpu": [ "x64" ], - "license": "MIT", "optional": true, "os": [ "win32" @@ -3503,11 +2461,19 @@ "node": ">= 10" } }, + "node_modules/arctic/node_modules/@tybys/wasm-util": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.8.3.tgz", + "integrity": "sha512-Z96T/L6dUFFxgFJ+pQtkPpne9q7i6kIPYCFnQBHSgSPV9idTsKfIhCss0h5iM9irweZCatkrdeP8yi5uM1eX6Q==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/arctic/node_modules/oslo": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/oslo/-/oslo-1.2.0.tgz", "integrity": "sha512-OoFX6rDsNcOQVAD2gQD/z03u4vEjWZLzJtwkmgfRF+KpQUXwdgEXErD7zNhyowmHwHefP+PM9Pw13pgpHMRlzw==", - "license": "MIT", "dependencies": { "@node-rs/argon2": "1.7.0", "@node-rs/bcrypt": "1.9.0" @@ -3519,20 +2485,20 @@ "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==" }, "node_modules/aria-query": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", - "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", - "dependencies": { - "dequal": "^2.0.3" + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", + "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", + "engines": { + "node": ">= 0.4" } }, "node_modules/array-buffer-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", - "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", "dependencies": { - "call-bind": "^1.0.5", - "is-array-buffer": "^3.0.4" + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" }, "engines": { "node": ">= 0.4" @@ -3560,9 +2526,9 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/autoprefixer": { - "version": "10.4.17", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.17.tgz", - "integrity": "sha512-/cpVNRLSfhOtcGflT13P2794gVSgmPgTR+erw5ifnMLZb0UnSlkK4tquLmkd3BhA+nLo5tX8Cu0upUsGKvKbmg==", + "version": "10.4.20", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz", + "integrity": "sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==", "funding": [ { "type": "opencollective", @@ -3578,11 +2544,11 @@ } ], "dependencies": { - "browserslist": "^4.22.2", - "caniuse-lite": "^1.0.30001578", + "browserslist": "^4.23.3", + "caniuse-lite": "^1.0.30001646", "fraction.js": "^4.3.7", "normalize-range": "^0.1.2", - "picocolors": "^1.0.0", + "picocolors": "^1.0.1", "postcss-value-parser": "^4.2.0" }, "bin": { @@ -3596,9 +2562,12 @@ } }, "node_modules/available-typed-arrays": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.6.tgz", - "integrity": "sha512-j1QzY8iPNPG4o4xmO3ptzpRxTciqD3MgEHtifP/YnJpIo58Xu+ne4BejlbkuaLfXn/nz6HFiw29bLpj2PNMdGg==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -3607,11 +2576,11 @@ } }, "node_modules/axios": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", - "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", + "version": "1.7.9", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", + "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", "dependencies": { - "follow-redirects": "^1.15.4", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -3641,11 +2610,14 @@ ] }, "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/bl": { @@ -3690,20 +2662,20 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" } }, "node_modules/browserslist": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", - "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", "funding": [ { "type": "opencollective", @@ -3719,10 +2691,10 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001587", - "electron-to-chromium": "^1.4.668", - "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.13" + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" }, "bin": { "browserslist": "cli.js" @@ -3754,14 +2726,6 @@ "ieee754": "^1.1.13" } }, - "node_modules/buffer-writer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", - "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==", - "engines": { - "node": ">=4" - } - }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -3779,15 +2743,41 @@ } }, "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "dependencies": { + "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -3805,9 +2795,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001588", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001588.tgz", - "integrity": "sha512-+hVY9jE44uKLkH0SrUTqxjxqNTOWHsbnQDIKjwkZ3lNTzUUVdBLBGXtj/q5Mp5u98r3droaZAewQuEDzjQdZlQ==", + "version": "1.0.30001692", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001692.tgz", + "integrity": "sha512-A95VKan0kdtrsnMubMKxEKUKImOPSuCpYgxSQBo036P5YYgVIcOYJEgt/txJWqObiRQeISNCfef9nvlQ0vbV7A==", "funding": [ { "type": "opencollective", @@ -3824,9 +2814,9 @@ ] }, "node_modules/chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", + "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", "dependencies": { "assertion-error": "^1.1.0", "check-error": "^1.0.3", @@ -3834,7 +2824,7 @@ "get-func-name": "^2.0.2", "loupe": "^2.3.6", "pathval": "^1.1.1", - "type-detect": "^4.0.8" + "type-detect": "^4.1.0" }, "engines": { "node": ">=4" @@ -4077,6 +3067,11 @@ "node": ">= 6" } }, + "node_modules/confbox": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==" + }, "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -4135,9 +3130,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -4206,9 +3201,9 @@ "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==" }, "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", + "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", "dependencies": { "type-detect": "^4.0.0" }, @@ -4259,14 +3254,13 @@ } }, "node_modules/define-data-property": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.3.tgz", - "integrity": "sha512-h3GBouC+RPtNX2N0hHVLo2ZwPYurq8mLmXpOLTsw71gr7lHt5VaI4vVkDUNOfiWmm48JEXe3VM7PmLX45AMmmg==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dependencies": { + "es-define-property": "^1.0.0", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.1" + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -4318,14 +3312,6 @@ "node": ">= 0.8" } }, - "node_modules/dequal": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", - "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", - "engines": { - "node": ">=6" - } - }, "node_modules/destroy": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", @@ -4370,6 +3356,19 @@ "node": ">=12" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -4381,9 +3380,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.4.673", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.673.tgz", - "integrity": "sha512-zjqzx4N7xGdl5468G+vcgzDhaHkaYgVcf9MqgexcTqsl2UHSCmOj/Bi3HAprg4BZCpC7HyD8a6nZl6QAZf72gw==" + "version": "1.5.81", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.81.tgz", + "integrity": "sha512-SFsAz1hoR+u1eAWjofSPQnx0InE1QHGUAQ92pqYJPT8GARzmyP1zcEBDBxFFC6okJk2E94Ryfmib4DB8Sc6LBw==" }, "node_modules/emoji-regex": { "version": "9.2.2", @@ -4410,12 +3409,9 @@ } }, "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dependencies": { - "get-intrinsic": "^1.2.4" - }, + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "engines": { "node": ">= 0.4" } @@ -4447,6 +3443,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-object-atoms": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.1.tgz", + "integrity": "sha512-BPOBuyUF9QIVhuNLhbToCLHP6+0MHwZ7xLBkPPCZqK4JmpJgGnv10035STzzQwFpqdzNFMB3irvDI63IagvDwA==", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/esbuild": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", @@ -4485,9 +3492,9 @@ } }, "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "engines": { "node": ">=6" } @@ -4625,9 +3632,9 @@ } }, "node_modules/express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -4648,7 +3655,7 @@ "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", @@ -4663,6 +3670,10 @@ }, "engines": { "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/external-editor": { @@ -4679,15 +3690,15 @@ } }, "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "micromatch": "^4.0.8" }, "engines": { "node": ">=8.6.0" @@ -4705,9 +3716,9 @@ } }, "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.18.0.tgz", + "integrity": "sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==", "dependencies": { "reusify": "^1.0.4" } @@ -4732,9 +3743,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -4760,14 +3771,14 @@ } }, "node_modules/flatted": { - "version": "3.2.9", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", - "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==" }, "node_modules/follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", "funding": [ { "type": "individual", @@ -4792,9 +3803,9 @@ } }, "node_modules/foreground-child": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", - "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", "dependencies": { "cross-spawn": "^7.0.0", "signal-exit": "^4.0.1" @@ -4807,9 +3818,9 @@ } }, "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -4848,9 +3859,9 @@ } }, "node_modules/fs-monkey": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.5.tgz", - "integrity": "sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.6.tgz", + "integrity": "sha512-b1FMfwetIKymC0eioW7mTywihSQE4oLzQn1dB6rZB5fx/3NpNEdAWeCSMB+60/AeT0TCXsxzAlcYVEFCTAksWg==", "optional": true }, "node_modules/fsevents": { @@ -4899,15 +3910,20 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", + "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "get-proto": "^1.0.0", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -4916,6 +3932,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-stream": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", @@ -4928,22 +3956,20 @@ } }, "node_modules/glob": { - "version": "10.3.10", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", - "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.5", - "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, "funding": { "url": "https://github.com/sponsors/isaacs" } @@ -4960,28 +3986,31 @@ } }, "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dependencies": { - "get-intrinsic": "^1.1.3" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/graphql": { - "version": "16.8.1", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", - "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", + "version": "16.10.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.10.0.tgz", + "integrity": "sha512-AjqGKbDGUFRKIRCP9tCKiIGHyriz2oHEbPIbEtcSLSs4YjReZOIPQQWek4+6hjw62H9QShXHyaGivGiYVLeYFQ==", "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } }, "node_modules/has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -5005,21 +4034,10 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "engines": { "node": ">= 0.4" }, @@ -5042,9 +4060,9 @@ } }, "node_modules/hasown": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", - "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dependencies": { "function-bind": "^1.1.2" }, @@ -5097,11 +4115,11 @@ } }, "node_modules/http-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -5113,9 +4131,9 @@ } }, "node_modules/http-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/https-proxy-agent": { "version": "5.0.1", @@ -5130,11 +4148,11 @@ } }, "node_modules/https-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -5146,9 +4164,9 @@ } }, "node_modules/https-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/human-signals": { "version": "5.0.0", @@ -5306,13 +4324,13 @@ } }, "node_modules/internal-slot": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", - "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", "dependencies": { "es-errors": "^1.3.0", - "hasown": "^2.0.0", - "side-channel": "^1.0.4" + "hasown": "^2.0.2", + "side-channel": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -5327,12 +4345,12 @@ } }, "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", + "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -5342,12 +4360,13 @@ } }, "node_modules/is-array-buffer": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", - "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -5357,11 +4376,14 @@ } }, "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", "dependencies": { - "has-bigints": "^1.0.1" + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5379,12 +4401,12 @@ } }, "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.1.tgz", + "integrity": "sha512-l9qO6eFlUETHtuihLcYOaLKByJ1f+N4kthcU9YjHy3N+B3hWv0y/2Nd0mu/7lTFnRQHTrSdXF50HQ3bl5fEnng==", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -5405,22 +4427,26 @@ } }, "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -5446,11 +4472,14 @@ } }, "node_modules/is-generator-function": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -5479,9 +4508,12 @@ } }, "node_modules/is-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", - "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -5500,11 +4532,12 @@ } }, "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -5519,12 +4552,14 @@ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==" }, "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -5534,19 +4569,25 @@ } }, "node_modules/is-set": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", - "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", "dependencies": { - "call-bind": "^1.0.2" + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5564,11 +4605,12 @@ } }, "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -5578,11 +4620,13 @@ } }, "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", "dependencies": { - "has-symbols": "^1.0.2" + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -5592,11 +4636,11 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", - "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", "dependencies": { - "which-typed-array": "^1.1.14" + "which-typed-array": "^1.1.16" }, "engines": { "node": ">= 0.4" @@ -5617,20 +4661,26 @@ } }, "node_modules/is-weakmap": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", - "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-weakset": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", - "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5658,15 +4708,12 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/jackspeak": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", - "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "dependencies": { "@isaacs/cliui": "^8.0.2" }, - "engines": { - "node": ">=14" - }, "funding": { "url": "https://github.com/sponsors/isaacs" }, @@ -5675,9 +4722,9 @@ } }, "node_modules/jiti": { - "version": "1.21.0", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz", - "integrity": "sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==", + "version": "1.21.7", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", + "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", "bin": { "jiti": "bin/jiti.js" } @@ -5739,17 +4786,15 @@ } } }, - "node_modules/jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==" - }, "node_modules/lilconfig": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", - "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", "engines": { - "node": ">=10" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" } }, "node_modules/lines-and-columns": { @@ -5758,12 +4803,12 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" }, "node_modules/local-pkg": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", - "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.1.tgz", + "integrity": "sha512-9rrA30MRRP3gBD3HTGnC6cDFpaE1kVDWxWgqWJUN0RvDNAo+Nz/9GxB+nHOH0ifbVFy0hSA1V6vFDvnx54lTEQ==", "dependencies": { - "mlly": "^1.4.2", - "pkg-types": "^1.0.3" + "mlly": "^1.7.3", + "pkg-types": "^1.2.1" }, "engines": { "node": ">=14" @@ -5861,25 +4906,23 @@ } }, "node_modules/lru-cache": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", - "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", - "engines": { - "node": "14 || >=16.14" - } + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" }, "node_modules/lucia": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lucia/-/lucia-3.0.1.tgz", - "integrity": "sha512-srwUkTCGgr6N4mFpaKZVZy5kwiRZdsrbIDv9Wrjar+xyw1MjojYQQ7oRbegjRWOZ3yI8xOOclK3sz/rga2J7/w==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/lucia/-/lucia-3.2.2.tgz", + "integrity": "sha512-P1FlFBGCMPMXu+EGdVD9W4Mjm0DqsusmKgO7Xc33mI5X1bklmsQb0hfzPhXomQr9waWIBDsiOjvr1e6BTaUqpA==", "dependencies": { - "oslo": "1.0.1" + "@oslojs/crypto": "^1.0.1", + "@oslojs/encoding": "^1.1.0" } }, "node_modules/luxon": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.4.tgz", - "integrity": "sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.5.0.tgz", + "integrity": "sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==", "engines": { "node": ">=12" } @@ -5893,14 +4936,19 @@ } }, "node_modules/magic-string": { - "version": "0.30.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.7.tgz", - "integrity": "sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==", + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" - }, + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", "engines": { - "node": ">=12" + "node": ">= 0.4" } }, "node_modules/media-typer": { @@ -5962,11 +5010,11 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -6028,9 +5076,9 @@ } }, "node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -6042,9 +5090,9 @@ } }, "node_modules/minipass": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", - "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "engines": { "node": ">=16 || 14 >=14.17" } @@ -6055,16 +5103,21 @@ "integrity": "sha512-7dX2/10ITVyqh4aOSVI9gdape+t9l2/8QxHrFmUXu4EEUpdlxl6RudZUPZoc+zuY2hk1j7XxVroIVIan/pD/SQ==" }, "node_modules/mlly": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.5.0.tgz", - "integrity": "sha512-NPVQvAY1xr1QoVeG0cy8yUYC7FQcOx6evl/RjT1wL5FvzPnzOysoqB/jmx/DhssT2dYa8nxECLAaFI/+gVLhDQ==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.4.tgz", + "integrity": "sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==", "dependencies": { - "acorn": "^8.11.3", - "pathe": "^1.1.2", - "pkg-types": "^1.0.3", - "ufo": "^1.3.2" + "acorn": "^8.14.0", + "pathe": "^2.0.1", + "pkg-types": "^1.3.0", + "ufo": "^1.5.4" } }, + "node_modules/mlly/node_modules/pathe": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.1.tgz", + "integrity": "sha512-6jpjMpOth5S9ITVu5clZ7NOgHNsv5vRQdheL9ztp2vZmM6fRbLvyua1tiBIL4lk8SAe3ARzeXEly6siXCjDHDw==" + }, "node_modules/mrmime": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", @@ -6079,9 +5132,9 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/msw": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/msw/-/msw-1.3.2.tgz", - "integrity": "sha512-wKLhFPR+NitYTkQl5047pia0reNGgf0P6a1eTnA5aNlripmiz0sabMvvHcicE8kQ3/gZcI0YiPFWmYfowfm3lA==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/msw/-/msw-1.3.5.tgz", + "integrity": "sha512-nG3fpmBXxFbKSIdk6miPuL3KjU6WMxgoW4tG1YgnP1M+TRG3Qn7b7R0euKAHq4vpwARHb18ZyfZljSxsTnMX2w==", "hasInstallScript": true, "dependencies": { "@mswjs/cookies": "^0.2.2", @@ -6099,7 +5152,7 @@ "js-levenshtein": "^1.1.6", "node-fetch": "^2.6.7", "outvariant": "^1.4.0", - "path-to-regexp": "^6.2.0", + "path-to-regexp": "^6.3.0", "strict-event-emitter": "^0.4.3", "type-fest": "^2.19.0", "yargs": "^17.3.1" @@ -6115,7 +5168,7 @@ "url": "https://opencollective.com/mswjs" }, "peerDependencies": { - "typescript": ">= 4.4.x <= 5.2.x" + "typescript": ">= 4.4.x" }, "peerDependenciesMeta": { "typescript": { @@ -6161,9 +5214,9 @@ } }, "node_modules/msw/node_modules/path-to-regexp": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", - "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==" + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", + "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==" }, "node_modules/mute-stream": { "version": "0.0.8", @@ -6181,9 +5234,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "funding": [ { "type": "github", @@ -6244,14 +5297,14 @@ } }, "node_modules/node-releases": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", - "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==" }, "node_modules/nodemailer": { - "version": "6.9.9", - "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.9.tgz", - "integrity": "sha512-dexTll8zqQoVJEZPwQAKzxxtFn0qTnjdQTchoU6Re9BUUGBJiOy3YMn/0ShTW6J5M0dfQ1NeDeRTTl4oIWgQMA==", + "version": "6.9.16", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.16.tgz", + "integrity": "sha512-psAuZdTIRN08HKVd/E8ObdV6NO7NTBY3KsC30F7M4H1OnmLCUNaS56FpYxyb26zWLSyYF9Ozch9KYHhHegsiOQ==", "engines": { "node": ">=6.0.0" } @@ -6273,9 +5326,9 @@ } }, "node_modules/npm-run-path": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", - "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "dependencies": { "path-key": "^4.0.0" }, @@ -6298,9 +5351,9 @@ } }, "node_modules/nwsapi": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", - "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==" + "version": "2.2.16", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.16.tgz", + "integrity": "sha512-F1I/bimDpj3ncaNDhfyMWuFqmQDBwDB0Fogc2qpL3BWvkQteFD/8BzWuIRl83rq0DXfm8SGt/HFhLXZyljTXcQ==" }, "node_modules/object-assign": { "version": "4.1.1", @@ -6319,20 +5372,23 @@ } }, "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object-is": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", - "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", + "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1" }, "engines": { "node": ">= 0.4" @@ -6350,13 +5406,15 @@ } }, "node_modules/object.assign": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", - "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", "dependencies": { - "call-bind": "^1.0.5", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "define-properties": "^1.2.1", - "has-symbols": "^1.0.3", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", "object-keys": "^1.1.1" }, "engines": { @@ -6418,70 +5476,334 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "engines": { - "node": ">=8" + "node": ">=8" + } + }, + "node_modules/ora/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ora/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ora/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/oslo": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/oslo/-/oslo-1.2.1.tgz", + "integrity": "sha512-HfIhB5ruTdQv0XX2XlncWQiJ5SIHZ7NHZhVyHth0CSZ/xzge00etRyYy/3wp/Dsu+PkxMC+6+B2lS/GcKoewkA==", + "dependencies": { + "@node-rs/argon2": "1.7.0", + "@node-rs/bcrypt": "1.9.0" + } + }, + "node_modules/oslo/node_modules/@emnapi/core": { + "version": "0.45.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-0.45.0.tgz", + "integrity": "sha512-DPWjcUDQkCeEM4VnljEOEcXdAD7pp8zSZsgOujk/LGIwCXWbXJngin+MO4zbH429lzeC3WbYLGjE2MaUOwzpyw==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/oslo/node_modules/@emnapi/runtime": { + "version": "0.45.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-0.45.0.tgz", + "integrity": "sha512-Txumi3td7J4A/xTTwlssKieHKTGl3j4A1tglBx72auZ49YK7ePY6XZricgIg9mnZT4xPfA+UPCUdnhRuEFDL+w==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/oslo/node_modules/@node-rs/argon2": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2/-/argon2-1.7.0.tgz", + "integrity": "sha512-zfULc+/tmcWcxn+nHkbyY8vP3+MpEqKORbszt4UkpqZgBgDAAIYvuDN/zukfTgdmo6tmJKKVfzigZOPk4LlIog==", + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@node-rs/argon2-android-arm-eabi": "1.7.0", + "@node-rs/argon2-android-arm64": "1.7.0", + "@node-rs/argon2-darwin-arm64": "1.7.0", + "@node-rs/argon2-darwin-x64": "1.7.0", + "@node-rs/argon2-freebsd-x64": "1.7.0", + "@node-rs/argon2-linux-arm-gnueabihf": "1.7.0", + "@node-rs/argon2-linux-arm64-gnu": "1.7.0", + "@node-rs/argon2-linux-arm64-musl": "1.7.0", + "@node-rs/argon2-linux-x64-gnu": "1.7.0", + "@node-rs/argon2-linux-x64-musl": "1.7.0", + "@node-rs/argon2-wasm32-wasi": "1.7.0", + "@node-rs/argon2-win32-arm64-msvc": "1.7.0", + "@node-rs/argon2-win32-ia32-msvc": "1.7.0", + "@node-rs/argon2-win32-x64-msvc": "1.7.0" + } + }, + "node_modules/oslo/node_modules/@node-rs/argon2-android-arm-eabi": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-android-arm-eabi/-/argon2-android-arm-eabi-1.7.0.tgz", + "integrity": "sha512-udDqkr5P9E+wYX1SZwAVPdyfYvaF4ry9Tm+R9LkfSHbzWH0uhU6zjIwNRp7m+n4gx691rk+lqqDAIP8RLKwbhg==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/oslo/node_modules/@node-rs/argon2-android-arm64": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-android-arm64/-/argon2-android-arm64-1.7.0.tgz", + "integrity": "sha512-s9j/G30xKUx8WU50WIhF0fIl1EdhBGq0RQ06lEhZ0Gi0ap8lhqbE2Bn5h3/G2D1k0Dx+yjeVVNmt/xOQIRG38A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/oslo/node_modules/@node-rs/argon2-darwin-arm64": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-darwin-arm64/-/argon2-darwin-arm64-1.7.0.tgz", + "integrity": "sha512-ZIz4L6HGOB9U1kW23g+m7anGNuTZ0RuTw0vNp3o+2DWpb8u8rODq6A8tH4JRL79S+Co/Nq608m9uackN2pe0Rw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/oslo/node_modules/@node-rs/argon2-darwin-x64": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-darwin-x64/-/argon2-darwin-x64-1.7.0.tgz", + "integrity": "sha512-5oi/pxqVhODW/pj1+3zElMTn/YukQeywPHHYDbcAW3KsojFjKySfhcJMd1DjKTc+CHQI+4lOxZzSUzK7mI14Hw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/oslo/node_modules/@node-rs/argon2-freebsd-x64": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-freebsd-x64/-/argon2-freebsd-x64-1.7.0.tgz", + "integrity": "sha512-Ify08683hA4QVXYoIm5SUWOY5DPIT/CMB0CQT+IdxQAg/F+qp342+lUkeAtD5bvStQuCx/dFO3bnnzoe2clMhA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/oslo/node_modules/@node-rs/argon2-linux-arm-gnueabihf": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-arm-gnueabihf/-/argon2-linux-arm-gnueabihf-1.7.0.tgz", + "integrity": "sha512-7DjDZ1h5AUHAtRNjD19RnQatbhL+uuxBASuuXIBu4/w6Dx8n7YPxwTP4MXfsvuRgKuMWiOb/Ub/HJ3kXVCXRkg==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/oslo/node_modules/@node-rs/argon2-linux-arm64-gnu": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-arm64-gnu/-/argon2-linux-arm64-gnu-1.7.0.tgz", + "integrity": "sha512-nJDoMP4Y3YcqGswE4DvP080w6O24RmnFEDnL0emdI8Nou17kNYBzP2546Nasx9GCyLzRcYQwZOUjrtUuQ+od2g==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/oslo/node_modules/@node-rs/argon2-linux-arm64-musl": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-arm64-musl/-/argon2-linux-arm64-musl-1.7.0.tgz", + "integrity": "sha512-BKWS8iVconhE3jrb9mj6t1J9vwUqQPpzCbUKxfTGJfc+kNL58F1SXHBoe2cDYGnHrFEHTY0YochzXoAfm4Dm/A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/oslo/node_modules/@node-rs/argon2-linux-x64-gnu": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-x64-gnu/-/argon2-linux-x64-gnu-1.7.0.tgz", + "integrity": "sha512-EmgqZOlf4Jurk/szW1iTsVISx25bKksVC5uttJDUloTgsAgIGReCpUUO1R24pBhu9ESJa47iv8NSf3yAfGv6jQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/oslo/node_modules/@node-rs/argon2-linux-x64-musl": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-linux-x64-musl/-/argon2-linux-x64-musl-1.7.0.tgz", + "integrity": "sha512-/o1efYCYIxjfuoRYyBTi2Iy+1iFfhqHCvvVsnjNSgO1xWiWrX0Rrt/xXW5Zsl7vS2Y+yu8PL8KFWRzZhaVxfKA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" } }, - "node_modules/ora/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/oslo/node_modules/@node-rs/argon2-wasm32-wasi": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-wasm32-wasi/-/argon2-wasm32-wasi-1.7.0.tgz", + "integrity": "sha512-Evmk9VcxqnuwQftfAfYEr6YZYSPLzmKUsbFIMep5nTt9PT4XYRFAERj7wNYp+rOcBenF3X4xoB+LhwcOMTNE5w==", + "cpu": [ + "wasm32" + ], + "optional": true, "dependencies": { - "color-convert": "^2.0.1" + "@emnapi/core": "^0.45.0", + "@emnapi/runtime": "^0.45.0", + "@tybys/wasm-util": "^0.8.1", + "memfs-browser": "^3.4.13000" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": ">=14.0.0" } }, - "node_modules/ora/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, + "node_modules/oslo/node_modules/@node-rs/argon2-win32-arm64-msvc": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-arm64-msvc/-/argon2-win32-arm64-msvc-1.7.0.tgz", + "integrity": "sha512-qgsU7T004COWWpSA0tppDqDxbPLgg8FaU09krIJ7FBl71Sz8SFO40h7fDIjfbTT5w7u6mcaINMQ5bSHu75PCaA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">= 10" } }, - "node_modules/ora/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, + "node_modules/oslo/node_modules/@node-rs/argon2-win32-ia32-msvc": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-ia32-msvc/-/argon2-win32-ia32-msvc-1.7.0.tgz", + "integrity": "sha512-JGafwWYQ/HpZ3XSwP4adQ6W41pRvhcdXvpzIWtKvX+17+xEXAe2nmGWM6s27pVkg1iV2ZtoYLRDkOUoGqZkCcg==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=8" + "node": ">= 10" } }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "node_modules/oslo/node_modules/@node-rs/argon2-win32-x64-msvc": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@node-rs/argon2-win32-x64-msvc/-/argon2-win32-x64-msvc-1.7.0.tgz", + "integrity": "sha512-9oq4ShyFakw8AG3mRls0AoCpxBFcimYx7+jvXeAf2OqKNO+mSA6eZ9z7KQeVCi0+SOEUYxMGf5UiGiDb9R6+9Q==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=0.10.0" + "node": ">= 10" } }, - "node_modules/oslo": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/oslo/-/oslo-1.0.1.tgz", - "integrity": "sha512-esfzZry+HfGgK/GCYkg7BRlLd3RH5aHa08wgLJPYjENXybi0BvXxGk0LbUj+lXfz2TkjPDHe4rB/o6JxRLHxBg==", + "node_modules/oslo/node_modules/@tybys/wasm-util": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.8.3.tgz", + "integrity": "sha512-Z96T/L6dUFFxgFJ+pQtkPpne9q7i6kIPYCFnQBHSgSPV9idTsKfIhCss0h5iM9irweZCatkrdeP8yi5uM1eX6Q==", + "optional": true, "dependencies": { - "@node-rs/argon2": "1.7.2", - "@node-rs/bcrypt": "1.9.2" + "tslib": "^2.4.0" } }, "node_modules/outvariant": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/outvariant/-/outvariant-1.4.2.tgz", - "integrity": "sha512-Ou3dJ6bA/UJ5GVHxah4LnqDwZRwAmWxrG3wtrHrbGnP4RnLCtA64A4F+ae7Y8ww660JaddSoArUR5HjipWSHAQ==" + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/outvariant/-/outvariant-1.4.3.tgz", + "integrity": "sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==" }, "node_modules/p-limit": { "version": "5.0.0", @@ -6511,17 +5833,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/packet-reader": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", - "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==" + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==" }, "node_modules/parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz", + "integrity": "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==", "dependencies": { - "entities": "^4.4.0" + "entities": "^4.5.0" }, "funding": { "url": "https://github.com/inikulin/parse5?sponsor=1" @@ -6549,24 +5871,24 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-scurry": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", - "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dependencies": { - "lru-cache": "^9.1.1 || ^10.0.0", + "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" }, "node_modules/pathe": { "version": "1.1.2", @@ -6582,15 +5904,13 @@ } }, "node_modules/pg": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.11.3.tgz", - "integrity": "sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==", - "dependencies": { - "buffer-writer": "2.0.0", - "packet-reader": "1.0.0", - "pg-connection-string": "^2.6.2", - "pg-pool": "^3.6.1", - "pg-protocol": "^1.6.0", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.13.1.tgz", + "integrity": "sha512-OUir1A0rPNZlX//c7ksiu7crsGZTKSOXJPgtNiHGIlC9H0lO+NC6ZDYksSgBYY/thSWhnSRBv8w1lieNNGATNQ==", + "dependencies": { + "pg-connection-string": "^2.7.0", + "pg-pool": "^3.7.0", + "pg-protocol": "^1.7.0", "pg-types": "^2.1.0", "pgpass": "1.x" }, @@ -6633,9 +5953,9 @@ "optional": true }, "node_modules/pg-connection-string": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz", - "integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==" + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.7.0.tgz", + "integrity": "sha512-PI2W9mv53rXJQEOb8xNR8lH7Hr+EKa6oJa38zsK0S/ky2er16ios1wLKhZyxzD7jUReiWokc9WK5nxSnC7W1TA==" }, "node_modules/pg-int8": { "version": "1.0.1", @@ -6646,17 +5966,17 @@ } }, "node_modules/pg-pool": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.1.tgz", - "integrity": "sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.7.0.tgz", + "integrity": "sha512-ZOBQForurqh4zZWjrgSwwAtzJ7QiRX0ovFkZr2klsen3Nm0aoh33Ls0fzfv3imeH/nw/O27cjdz5kzYJfeGp/g==", "peerDependencies": { "pg": ">=8.0" } }, "node_modules/pg-protocol": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.0.tgz", - "integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==" + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.7.0.tgz", + "integrity": "sha512-hTK/mE36i8fDDhgDFjy6xNOG+LCorxLG3WO17tku+ij6sVHXh1jQUJ8hYAnRhNla4QVD2H8er/FOjc/+EgC6yQ==" }, "node_modules/pg-types": { "version": "2.2.0", @@ -6682,9 +6002,9 @@ } }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -6714,19 +6034,32 @@ } }, "node_modules/pkg-types": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", - "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", + "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", "dependencies": { - "jsonc-parser": "^3.2.0", - "mlly": "^1.2.0", - "pathe": "^1.1.0" + "confbox": "^0.1.8", + "mlly": "^1.7.4", + "pathe": "^2.0.1" + } + }, + "node_modules/pkg-types/node_modules/pathe": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.1.tgz", + "integrity": "sha512-6jpjMpOth5S9ITVu5clZ7NOgHNsv5vRQdheL9ztp2vZmM6fRbLvyua1tiBIL4lk8SAe3ARzeXEly6siXCjDHDw==" + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "engines": { + "node": ">= 0.4" } }, "node_modules/postcss": { - "version": "8.4.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", - "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.1.tgz", + "integrity": "sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==", "funding": [ { "type": "opencollective", @@ -6742,9 +6075,9 @@ } ], "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "nanoid": "^3.3.8", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" @@ -6818,36 +6151,34 @@ } } }, - "node_modules/postcss-load-config/node_modules/lilconfig": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", - "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", - "engines": { - "node": ">=14" - } - }, "node_modules/postcss-nested": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.0.1.tgz", - "integrity": "sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", + "integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "dependencies": { - "postcss-selector-parser": "^6.0.11" + "postcss-selector-parser": "^6.1.1" }, "engines": { "node": ">=12.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, "peerDependencies": { "postcss": "^8.2.14" } }, "node_modules/postcss-nested/node_modules/postcss-selector-parser": { - "version": "6.0.15", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.15.tgz", - "integrity": "sha512-rEYkQOMUCEMhsKbK66tbEU9QVIxbhN18YiniAwA7XQYTVBqrBy+P2p5JcdqsHgKM2zWylp8d7J6eszocfds5Sw==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -6945,7 +6276,6 @@ "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.19.1.tgz", "integrity": "sha512-c5K9MiDaa+VAAyh1OiYk76PXOme9s3E992D7kvvIOhCrNsBQfy2mP2QAQtX0WNj140IgG++12kwZpYB9iIydNQ==", "hasInstallScript": true, - "license": "Apache-2.0", "dependencies": { "@prisma/engines": "5.19.1" }, @@ -6977,9 +6307,15 @@ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, "node_modules/psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz", + "integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==", + "dependencies": { + "punycode": "^2.3.1" + }, + "funding": { + "url": "https://github.com/sponsors/lupomontero" + } }, "node_modules/punycode": { "version": "2.3.1", @@ -7050,9 +6386,9 @@ } }, "node_modules/react": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", - "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "dependencies": { "loose-envify": "^1.1.0" }, @@ -7061,30 +6397,30 @@ } }, "node_modules/react-dom": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", - "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "dependencies": { "loose-envify": "^1.1.0", - "scheduler": "^0.23.0" + "scheduler": "^0.23.2" }, "peerDependencies": { - "react": "^18.2.0" + "react": "^18.3.1" } }, "node_modules/react-hook-form": { - "version": "7.50.1", - "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.50.1.tgz", - "integrity": "sha512-3PCY82oE0WgeOgUtIr3nYNNtNvqtJ7BZjsbxh6TnYNbXButaD5WpjOmTjdxZfheuHKR68qfeFnEDVYoSSFPMTQ==", + "version": "7.54.2", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.54.2.tgz", + "integrity": "sha512-eHpAUgUjWbZocoQYUHposymRb4ZP6d0uwUnooL2uOybA9/3tPUvoAKqEWK1WaSiTxxOfTpffNZP7QwlnM3/gEg==", "engines": { - "node": ">=12.22.0" + "node": ">=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/react-hook-form" }, "peerDependencies": { - "react": "^16.8.0 || ^17 || ^18" + "react": "^16.8.0 || ^17 || ^18 || ^19" } }, "node_modules/react-is": { @@ -7093,11 +6429,11 @@ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, "node_modules/react-router": { - "version": "6.26.2", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz", - "integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==", + "version": "6.28.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.28.1.tgz", + "integrity": "sha512-2omQTA3rkMljmrvvo6WtewGdVh45SpL9hGiCI9uUrwGGfNFDIvGK4gYJsKlJoNVi6AQZcopSCballL+QGOm7fA==", "dependencies": { - "@remix-run/router": "1.19.2" + "@remix-run/router": "1.21.0" }, "engines": { "node": ">=14.0.0" @@ -7107,12 +6443,12 @@ } }, "node_modules/react-router-dom": { - "version": "6.26.2", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz", - "integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==", + "version": "6.28.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.28.1.tgz", + "integrity": "sha512-YraE27C/RdjcZwl5UCqF/ffXnZDxpJdk9Q6jw38SZHjXs7NNdpViq2l2c7fO7+4uWaEfcwfGCv3RSg4e1By/fQ==", "dependencies": { - "@remix-run/router": "1.19.2", - "react-router": "6.26.2" + "@remix-run/router": "1.21.0", + "react-router": "6.28.1" }, "engines": { "node": ">=14.0.0" @@ -7172,14 +6508,16 @@ "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" }, "node_modules/regexp.prototype.flags": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", - "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", "dependencies": { - "call-bind": "^1.0.6", + "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-errors": "^1.3.0", - "set-function-name": "^2.0.1" + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -7202,17 +6540,20 @@ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", "dependencies": { - "is-core-module": "^2.13.0", + "is-core-module": "^2.16.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -7244,9 +6585,9 @@ } }, "node_modules/rollup": { - "version": "3.29.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", - "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", + "version": "3.29.5", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.5.tgz", + "integrity": "sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -7321,6 +6662,22 @@ } ] }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -7338,9 +6695,9 @@ } }, "node_modules/scheduler": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", - "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", "dependencies": { "loose-envify": "^1.1.0" } @@ -7421,34 +6778,35 @@ } }, "node_modules/set-cookie-parser": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.6.0.tgz", - "integrity": "sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ==" + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz", + "integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==" }, "node_modules/set-function-length": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", - "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "dependencies": { - "define-data-property": "^1.1.2", + "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.3", + "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.1" + "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/set-function-name": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", - "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", "dependencies": { - "define-data-property": "^1.0.1", + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.0" + "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -7479,14 +6837,65 @@ } }, "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "dependencies": { - "call-bind": "^1.0.7", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -7534,9 +6943,9 @@ } }, "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "engines": { "node": ">=0.10.0" } @@ -7563,16 +6972,17 @@ } }, "node_modules/std-env": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", - "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==" + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.0.tgz", + "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==" }, "node_modules/stop-iteration-iterator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", - "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", + "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", "dependencies": { - "internal-slot": "^1.0.4" + "es-errors": "^1.3.0", + "internal-slot": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -7702,16 +7112,21 @@ } }, "node_modules/strip-literal": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", - "integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.1.tgz", + "integrity": "sha512-631UJ6O00eNGfMiWG78ck80dfBab8X6IVFB51jZK5Icd7XAs60Z5y7QdSd/wGIklnWvRbUNloVzhOKKmutxQ6Q==", "dependencies": { - "acorn": "^8.10.0" + "js-tokens": "^9.0.1" }, "funding": { "url": "https://github.com/sponsors/antfu" } }, + "node_modules/strip-literal/node_modules/js-tokens": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==" + }, "node_modules/sucrase": { "version": "3.35.0", "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz", @@ -7734,9 +7149,9 @@ } }, "node_modules/superjson": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/superjson/-/superjson-2.2.1.tgz", - "integrity": "sha512-8iGv75BYOa0xRJHK5vRLEjE2H/i4lulTjzpUXic3Eg8akftYjkmQDa8JARQ42rlczXyFR3IeRoeFCc7RxHsYZA==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/superjson/-/superjson-2.2.2.tgz", + "integrity": "sha512-5JRxVqC8I8NuOUjzBbvVJAKNM8qoVuH0O77h4WInc/qC2q5IreqKxYwgkga3PfA22OayK2ikceb/B26dztPl+Q==", "dependencies": { "copy-anything": "^3.0.2" }, @@ -7772,32 +7187,32 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" }, "node_modules/tailwindcss": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.1.tgz", - "integrity": "sha512-qAYmXRfk3ENzuPBakNK0SRrUDipP8NQnEY6772uDhflcQz5EhRdD7JNZxyrFHVQNCwULPBn6FNPp9brpO7ctcA==", + "version": "3.4.17", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.17.tgz", + "integrity": "sha512-w33E2aCvSDP0tW9RZuNXadXlkHXqFzSkQew/aIa2i/Sj8fThxwovwlXHSPXTbAHwEIhBFXAedUhP2tueAKP8Og==", "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", - "chokidar": "^3.5.3", + "chokidar": "^3.6.0", "didyoumean": "^1.2.2", "dlv": "^1.1.3", - "fast-glob": "^3.3.0", + "fast-glob": "^3.3.2", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", - "jiti": "^1.19.1", - "lilconfig": "^2.1.0", - "micromatch": "^4.0.5", + "jiti": "^1.21.6", + "lilconfig": "^3.1.3", + "micromatch": "^4.0.8", "normalize-path": "^3.0.0", "object-hash": "^3.0.0", - "picocolors": "^1.0.0", - "postcss": "^8.4.23", + "picocolors": "^1.1.1", + "postcss": "^8.4.47", "postcss-import": "^15.1.0", "postcss-js": "^4.0.1", - "postcss-load-config": "^4.0.1", - "postcss-nested": "^6.0.1", - "postcss-selector-parser": "^6.0.11", - "resolve": "^1.22.2", - "sucrase": "^3.32.0" + "postcss-load-config": "^4.0.2", + "postcss-nested": "^6.2.0", + "postcss-selector-parser": "^6.1.2", + "resolve": "^1.22.8", + "sucrase": "^3.35.0" }, "bin": { "tailwind": "lib/cli.js", @@ -7808,9 +7223,9 @@ } }, "node_modules/tailwindcss/node_modules/postcss-selector-parser": { - "version": "6.0.15", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.15.tgz", - "integrity": "sha512-rEYkQOMUCEMhsKbK66tbEU9QVIxbhN18YiniAwA7XQYTVBqrBy+P2p5JcdqsHgKM2zWylp8d7J6eszocfds5Sw==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -7844,14 +7259,14 @@ "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, "node_modules/tinybench": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", - "integrity": "sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==" + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==" }, "node_modules/tinypool": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", - "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", + "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", "engines": { "node": ">=14.0.0" } @@ -7903,9 +7318,9 @@ } }, "node_modules/tough-cookie": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", - "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", "dependencies": { "psl": "^1.1.33", "punycode": "^2.1.1", @@ -7933,14 +7348,14 @@ "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", "engines": { "node": ">=4" } @@ -7969,9 +7384,9 @@ } }, "node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", "devOptional": true, "bin": { "tsc": "bin/tsc", @@ -7982,14 +7397,14 @@ } }, "node_modules/ufo": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.4.0.tgz", - "integrity": "sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==" + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.4.tgz", + "integrity": "sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==" }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==" }, "node_modules/universalify": { "version": "0.2.0", @@ -8008,9 +7423,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", - "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz", + "integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==", "funding": [ { "type": "opencollective", @@ -8026,8 +7441,8 @@ } ], "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "escalade": "^3.2.0", + "picocolors": "^1.1.1" }, "bin": { "update-browserslist-db": "cli.js" @@ -8046,11 +7461,11 @@ } }, "node_modules/use-sync-external-store": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", - "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.4.0.tgz", + "integrity": "sha512-9WXSPC5fMv61vaupRkCKCxsPxBocVnwakBEkMIHHpkTTg6icbJtg6jzgtLDm4bl3cSHAca52rYWih0k4K3PfHw==", "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/util": { @@ -8099,9 +7514,9 @@ } }, "node_modules/vite": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.2.tgz", - "integrity": "sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.5.tgz", + "integrity": "sha512-ifW3Lb2sMdX+WU91s3R0FyQlAyLxOzCSCP37ujw0+r5POeHPwe6udWVIElKQq8gk3t7b8rkmvqC6IHBpCff4GQ==", "dev": true, "dependencies": { "esbuild": "^0.18.10", @@ -8154,9 +7569,9 @@ } }, "node_modules/vite-node": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.2.2.tgz", - "integrity": "sha512-1as4rDTgVWJO3n1uHmUYqq7nsFgINQ9u+mRcXpjeOMJUmviqNKjcZB7UfRZrlM7MjYXMKpuWp5oGkjaFLnjawg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", + "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", "dependencies": { "cac": "^6.7.14", "debug": "^4.3.4", @@ -8175,9 +7590,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/android-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", - "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", "cpu": [ "arm" ], @@ -8190,9 +7605,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/android-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", - "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", "cpu": [ "arm64" ], @@ -8205,9 +7620,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/android-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", - "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", "cpu": [ "x64" ], @@ -8220,9 +7635,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/darwin-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", - "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", "cpu": [ "arm64" ], @@ -8235,9 +7650,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/darwin-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", - "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", "cpu": [ "x64" ], @@ -8250,9 +7665,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", - "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", "cpu": [ "arm64" ], @@ -8265,9 +7680,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/freebsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", - "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", "cpu": [ "x64" ], @@ -8280,9 +7695,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/linux-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", - "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", "cpu": [ "arm" ], @@ -8295,9 +7710,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/linux-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", - "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", "cpu": [ "arm64" ], @@ -8310,9 +7725,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/linux-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", - "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", "cpu": [ "ia32" ], @@ -8325,9 +7740,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/linux-loong64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", - "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", "cpu": [ "loong64" ], @@ -8340,9 +7755,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/linux-mips64el": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", - "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", "cpu": [ "mips64el" ], @@ -8355,9 +7770,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/linux-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", - "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", "cpu": [ "ppc64" ], @@ -8370,9 +7785,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/linux-riscv64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", - "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", "cpu": [ "riscv64" ], @@ -8385,9 +7800,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/linux-s390x": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", - "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", "cpu": [ "s390x" ], @@ -8400,9 +7815,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/linux-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", - "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", "cpu": [ "x64" ], @@ -8415,9 +7830,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/netbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", - "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", "cpu": [ "x64" ], @@ -8430,9 +7845,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/openbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", - "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", "cpu": [ "x64" ], @@ -8445,9 +7860,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/sunos-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", - "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", "cpu": [ "x64" ], @@ -8460,9 +7875,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/win32-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", - "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", "cpu": [ "arm64" ], @@ -8475,9 +7890,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/win32-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", - "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", "cpu": [ "ia32" ], @@ -8490,9 +7905,9 @@ } }, "node_modules/vite-node/node_modules/@esbuild/win32-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", - "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", "cpu": [ "x64" ], @@ -8505,11 +7920,11 @@ } }, "node_modules/vite-node/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -8521,9 +7936,9 @@ } }, "node_modules/vite-node/node_modules/esbuild": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", - "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -8532,42 +7947,42 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.19.12", - "@esbuild/android-arm": "0.19.12", - "@esbuild/android-arm64": "0.19.12", - "@esbuild/android-x64": "0.19.12", - "@esbuild/darwin-arm64": "0.19.12", - "@esbuild/darwin-x64": "0.19.12", - "@esbuild/freebsd-arm64": "0.19.12", - "@esbuild/freebsd-x64": "0.19.12", - "@esbuild/linux-arm": "0.19.12", - "@esbuild/linux-arm64": "0.19.12", - "@esbuild/linux-ia32": "0.19.12", - "@esbuild/linux-loong64": "0.19.12", - "@esbuild/linux-mips64el": "0.19.12", - "@esbuild/linux-ppc64": "0.19.12", - "@esbuild/linux-riscv64": "0.19.12", - "@esbuild/linux-s390x": "0.19.12", - "@esbuild/linux-x64": "0.19.12", - "@esbuild/netbsd-x64": "0.19.12", - "@esbuild/openbsd-x64": "0.19.12", - "@esbuild/sunos-x64": "0.19.12", - "@esbuild/win32-arm64": "0.19.12", - "@esbuild/win32-ia32": "0.19.12", - "@esbuild/win32-x64": "0.19.12" + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" } }, "node_modules/vite-node/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/vite-node/node_modules/rollup": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.10.0.tgz", - "integrity": "sha512-t2v9G2AKxcQ8yrG+WGxctBes1AomT0M4ND7jTFBCVPXQ/WFTvNSefIrNSmLKhIKBrvN8SG+CZslimJcT3W2u2g==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.30.1.tgz", + "integrity": "sha512-mlJ4glW020fPuLi7DkM/lN97mYEZGWeqBnrljzN0gs7GLctqX3lNWxKQ7Gl712UAX+6fog/L3jh4gb7R6aVi3w==", "dependencies": { - "@types/estree": "1.0.5" + "@types/estree": "1.0.6" }, "bin": { "rollup": "dist/bin/rollup" @@ -8577,30 +7992,36 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.10.0", - "@rollup/rollup-android-arm64": "4.10.0", - "@rollup/rollup-darwin-arm64": "4.10.0", - "@rollup/rollup-darwin-x64": "4.10.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.10.0", - "@rollup/rollup-linux-arm64-gnu": "4.10.0", - "@rollup/rollup-linux-arm64-musl": "4.10.0", - "@rollup/rollup-linux-riscv64-gnu": "4.10.0", - "@rollup/rollup-linux-x64-gnu": "4.10.0", - "@rollup/rollup-linux-x64-musl": "4.10.0", - "@rollup/rollup-win32-arm64-msvc": "4.10.0", - "@rollup/rollup-win32-ia32-msvc": "4.10.0", - "@rollup/rollup-win32-x64-msvc": "4.10.0", + "@rollup/rollup-android-arm-eabi": "4.30.1", + "@rollup/rollup-android-arm64": "4.30.1", + "@rollup/rollup-darwin-arm64": "4.30.1", + "@rollup/rollup-darwin-x64": "4.30.1", + "@rollup/rollup-freebsd-arm64": "4.30.1", + "@rollup/rollup-freebsd-x64": "4.30.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.30.1", + "@rollup/rollup-linux-arm-musleabihf": "4.30.1", + "@rollup/rollup-linux-arm64-gnu": "4.30.1", + "@rollup/rollup-linux-arm64-musl": "4.30.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.30.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.30.1", + "@rollup/rollup-linux-riscv64-gnu": "4.30.1", + "@rollup/rollup-linux-s390x-gnu": "4.30.1", + "@rollup/rollup-linux-x64-gnu": "4.30.1", + "@rollup/rollup-linux-x64-musl": "4.30.1", + "@rollup/rollup-win32-arm64-msvc": "4.30.1", + "@rollup/rollup-win32-ia32-msvc": "4.30.1", + "@rollup/rollup-win32-x64-msvc": "4.30.1", "fsevents": "~2.3.2" } }, "node_modules/vite-node/node_modules/vite": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.1.tgz", - "integrity": "sha512-wclpAgY3F1tR7t9LL5CcHC41YPkQIpKUGeIuT8MdNwNZr6OqOTLs7JX5vIHAtzqLWXts0T+GDrh9pN2arneKqg==", + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", "dependencies": { - "esbuild": "^0.19.3", - "postcss": "^8.4.35", - "rollup": "^4.2.0" + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" }, "bin": { "vite": "bin/vite.js" @@ -8619,6 +8040,7 @@ "less": "*", "lightningcss": "^1.21.0", "sass": "*", + "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" @@ -8636,6 +8058,9 @@ "sass": { "optional": true }, + "sass-embedded": { + "optional": true + }, "stylus": { "optional": true }, @@ -8648,17 +8073,16 @@ } }, "node_modules/vitest": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.2.2.tgz", - "integrity": "sha512-d5Ouvrnms3GD9USIK36KG8OZ5bEvKEkITFtnGv56HFaSlbItJuYr7hv2Lkn903+AvRAgSixiamozUVfORUekjw==", - "dependencies": { - "@vitest/expect": "1.2.2", - "@vitest/runner": "1.2.2", - "@vitest/snapshot": "1.2.2", - "@vitest/spy": "1.2.2", - "@vitest/utils": "1.2.2", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", + "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", + "dependencies": { + "@vitest/expect": "1.6.0", + "@vitest/runner": "1.6.0", + "@vitest/snapshot": "1.6.0", + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", "acorn-walk": "^8.3.2", - "cac": "^6.7.14", "chai": "^4.3.10", "debug": "^4.3.4", "execa": "^8.0.1", @@ -8667,11 +8091,11 @@ "pathe": "^1.1.1", "picocolors": "^1.0.0", "std-env": "^3.5.0", - "strip-literal": "^1.3.0", + "strip-literal": "^2.0.0", "tinybench": "^2.5.1", - "tinypool": "^0.8.2", + "tinypool": "^0.8.3", "vite": "^5.0.0", - "vite-node": "1.2.2", + "vite-node": "1.6.0", "why-is-node-running": "^2.2.2" }, "bin": { @@ -8686,8 +8110,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "^1.0.0", - "@vitest/ui": "^1.0.0", + "@vitest/browser": "1.6.0", + "@vitest/ui": "1.6.0", "happy-dom": "*", "jsdom": "*" }, @@ -8713,9 +8137,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/android-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", - "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", "cpu": [ "arm" ], @@ -8728,9 +8152,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/android-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", - "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", "cpu": [ "arm64" ], @@ -8743,9 +8167,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/android-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", - "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", "cpu": [ "x64" ], @@ -8758,9 +8182,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/darwin-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", - "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", "cpu": [ "arm64" ], @@ -8773,9 +8197,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/darwin-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", - "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", "cpu": [ "x64" ], @@ -8788,9 +8212,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", - "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", "cpu": [ "arm64" ], @@ -8803,9 +8227,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/freebsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", - "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", "cpu": [ "x64" ], @@ -8818,9 +8242,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/linux-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", - "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", "cpu": [ "arm" ], @@ -8833,9 +8257,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/linux-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", - "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", "cpu": [ "arm64" ], @@ -8848,9 +8272,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/linux-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", - "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", "cpu": [ "ia32" ], @@ -8863,9 +8287,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/linux-loong64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", - "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", "cpu": [ "loong64" ], @@ -8878,9 +8302,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/linux-mips64el": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", - "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", "cpu": [ "mips64el" ], @@ -8893,9 +8317,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/linux-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", - "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", "cpu": [ "ppc64" ], @@ -8908,9 +8332,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/linux-riscv64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", - "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", "cpu": [ "riscv64" ], @@ -8923,9 +8347,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/linux-s390x": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", - "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", "cpu": [ "s390x" ], @@ -8938,9 +8362,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/linux-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", - "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", "cpu": [ "x64" ], @@ -8953,9 +8377,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/netbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", - "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", "cpu": [ "x64" ], @@ -8968,9 +8392,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/openbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", - "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", "cpu": [ "x64" ], @@ -8983,9 +8407,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/sunos-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", - "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", "cpu": [ "x64" ], @@ -8998,9 +8422,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/win32-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", - "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", "cpu": [ "arm64" ], @@ -9013,9 +8437,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/win32-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", - "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", "cpu": [ "ia32" ], @@ -9028,9 +8452,9 @@ } }, "node_modules/vitest/node_modules/@esbuild/win32-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", - "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", "cpu": [ "x64" ], @@ -9043,11 +8467,11 @@ } }, "node_modules/vitest/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -9059,9 +8483,9 @@ } }, "node_modules/vitest/node_modules/esbuild": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", - "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -9070,42 +8494,42 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.19.12", - "@esbuild/android-arm": "0.19.12", - "@esbuild/android-arm64": "0.19.12", - "@esbuild/android-x64": "0.19.12", - "@esbuild/darwin-arm64": "0.19.12", - "@esbuild/darwin-x64": "0.19.12", - "@esbuild/freebsd-arm64": "0.19.12", - "@esbuild/freebsd-x64": "0.19.12", - "@esbuild/linux-arm": "0.19.12", - "@esbuild/linux-arm64": "0.19.12", - "@esbuild/linux-ia32": "0.19.12", - "@esbuild/linux-loong64": "0.19.12", - "@esbuild/linux-mips64el": "0.19.12", - "@esbuild/linux-ppc64": "0.19.12", - "@esbuild/linux-riscv64": "0.19.12", - "@esbuild/linux-s390x": "0.19.12", - "@esbuild/linux-x64": "0.19.12", - "@esbuild/netbsd-x64": "0.19.12", - "@esbuild/openbsd-x64": "0.19.12", - "@esbuild/sunos-x64": "0.19.12", - "@esbuild/win32-arm64": "0.19.12", - "@esbuild/win32-ia32": "0.19.12", - "@esbuild/win32-x64": "0.19.12" + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" } }, "node_modules/vitest/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/vitest/node_modules/rollup": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.10.0.tgz", - "integrity": "sha512-t2v9G2AKxcQ8yrG+WGxctBes1AomT0M4ND7jTFBCVPXQ/WFTvNSefIrNSmLKhIKBrvN8SG+CZslimJcT3W2u2g==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.30.1.tgz", + "integrity": "sha512-mlJ4glW020fPuLi7DkM/lN97mYEZGWeqBnrljzN0gs7GLctqX3lNWxKQ7Gl712UAX+6fog/L3jh4gb7R6aVi3w==", "dependencies": { - "@types/estree": "1.0.5" + "@types/estree": "1.0.6" }, "bin": { "rollup": "dist/bin/rollup" @@ -9115,30 +8539,36 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.10.0", - "@rollup/rollup-android-arm64": "4.10.0", - "@rollup/rollup-darwin-arm64": "4.10.0", - "@rollup/rollup-darwin-x64": "4.10.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.10.0", - "@rollup/rollup-linux-arm64-gnu": "4.10.0", - "@rollup/rollup-linux-arm64-musl": "4.10.0", - "@rollup/rollup-linux-riscv64-gnu": "4.10.0", - "@rollup/rollup-linux-x64-gnu": "4.10.0", - "@rollup/rollup-linux-x64-musl": "4.10.0", - "@rollup/rollup-win32-arm64-msvc": "4.10.0", - "@rollup/rollup-win32-ia32-msvc": "4.10.0", - "@rollup/rollup-win32-x64-msvc": "4.10.0", + "@rollup/rollup-android-arm-eabi": "4.30.1", + "@rollup/rollup-android-arm64": "4.30.1", + "@rollup/rollup-darwin-arm64": "4.30.1", + "@rollup/rollup-darwin-x64": "4.30.1", + "@rollup/rollup-freebsd-arm64": "4.30.1", + "@rollup/rollup-freebsd-x64": "4.30.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.30.1", + "@rollup/rollup-linux-arm-musleabihf": "4.30.1", + "@rollup/rollup-linux-arm64-gnu": "4.30.1", + "@rollup/rollup-linux-arm64-musl": "4.30.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.30.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.30.1", + "@rollup/rollup-linux-riscv64-gnu": "4.30.1", + "@rollup/rollup-linux-s390x-gnu": "4.30.1", + "@rollup/rollup-linux-x64-gnu": "4.30.1", + "@rollup/rollup-linux-x64-musl": "4.30.1", + "@rollup/rollup-win32-arm64-msvc": "4.30.1", + "@rollup/rollup-win32-ia32-msvc": "4.30.1", + "@rollup/rollup-win32-x64-msvc": "4.30.1", "fsevents": "~2.3.2" } }, "node_modules/vitest/node_modules/vite": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.1.tgz", - "integrity": "sha512-wclpAgY3F1tR7t9LL5CcHC41YPkQIpKUGeIuT8MdNwNZr6OqOTLs7JX5vIHAtzqLWXts0T+GDrh9pN2arneKqg==", + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", "dependencies": { - "esbuild": "^0.19.3", - "postcss": "^8.4.35", - "rollup": "^4.2.0" + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" }, "bin": { "vite": "bin/vite.js" @@ -9157,6 +8587,7 @@ "less": "*", "lightningcss": "^1.21.0", "sass": "*", + "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" @@ -9174,6 +8605,9 @@ "sass": { "optional": true }, + "sass-embedded": { + "optional": true + }, "stylus": { "optional": true }, @@ -9284,44 +8718,51 @@ } }, "node_modules/which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/which-collection": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", - "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", "dependencies": { - "is-map": "^2.0.1", - "is-set": "^2.0.1", - "is-weakmap": "^2.0.1", - "is-weakset": "^2.0.1" + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/which-typed-array": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", - "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", + "version": "1.1.18", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.18.tgz", + "integrity": "sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==", "dependencies": { - "available-typed-arrays": "^1.0.6", - "call-bind": "^1.0.5", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.1" + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -9331,9 +8772,9 @@ } }, "node_modules/why-is-node-running": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", - "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" @@ -9430,9 +8871,9 @@ } }, "node_modules/ws": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", - "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "engines": { "node": ">=10.0.0" }, @@ -9479,9 +8920,12 @@ } }, "node_modules/yaml": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", + "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", + "bin": { + "yaml": "bin.mjs" + }, "engines": { "node": ">= 14" } @@ -9549,15 +8993,23 @@ } }, "node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", + "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", "engines": { "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zod": { + "version": "3.24.1", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.1.tgz", + "integrity": "sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } } } diff --git a/waspc/packages/wasp-config/src/appSpec.ts b/waspc/packages/wasp-config/src/appSpec.ts index 3742119513..41e2149c67 100644 --- a/waspc/packages/wasp-config/src/appSpec.ts +++ b/waspc/packages/wasp-config/src/appSpec.ts @@ -203,12 +203,14 @@ export type Ref = { export type Server = { setupFn: Optional middlewareConfigFn: Optional + envValidationSchema: Optional } export type Client = { setupFn: Optional rootComponent: Optional baseDir: Optional<`/${string}`> + envValidationSchema: Optional } export type Db = { diff --git a/waspc/packages/wasp-config/src/mapUserSpecToAppSpecDecls.ts b/waspc/packages/wasp-config/src/mapUserSpecToAppSpecDecls.ts index f611531154..e932a6831f 100644 --- a/waspc/packages/wasp-config/src/mapUserSpecToAppSpecDecls.ts +++ b/waspc/packages/wasp-config/src/mapUserSpecToAppSpecDecls.ts @@ -329,19 +329,21 @@ function mapEmailSender( } function mapServer(server: User.ServerConfig): AppSpec.Server { - const { setupFn, middlewareConfigFn } = server + const { setupFn, middlewareConfigFn, envValidationSchema } = server return { setupFn: setupFn && mapExtImport(setupFn), middlewareConfigFn: middlewareConfigFn && mapExtImport(middlewareConfigFn), + envValidationSchema: envValidationSchema && mapExtImport(envValidationSchema), } } function mapClient(client: User.ClientConfig): AppSpec.Client { - const { setupFn, rootComponent, baseDir } = client + const { setupFn, rootComponent, baseDir, envValidationSchema } = client return { setupFn: setupFn && mapExtImport(setupFn), rootComponent: rootComponent && mapExtImport(rootComponent), baseDir, + envValidationSchema: envValidationSchema && mapExtImport(envValidationSchema), } } diff --git a/waspc/packages/wasp-config/src/userApi.ts b/waspc/packages/wasp-config/src/userApi.ts index 02291b58ed..0e183fc03f 100644 --- a/waspc/packages/wasp-config/src/userApi.ts +++ b/waspc/packages/wasp-config/src/userApi.ts @@ -111,6 +111,7 @@ export type ExtImport = export type ServerConfig = { setupFn?: ExtImport middlewareConfigFn?: ExtImport + envValidationSchema?: ExtImport } export type PageConfig = { @@ -127,6 +128,7 @@ export type ClientConfig = { rootComponent?: ExtImport setupFn?: ExtImport baseDir?: `/${string}` + envValidationSchema?: ExtImport } export type DbConfig = { diff --git a/waspc/src/Wasp/AppSpec/App/Client.hs b/waspc/src/Wasp/AppSpec/App/Client.hs index 2764c9205d..8adb0f912e 100644 --- a/waspc/src/Wasp/AppSpec/App/Client.hs +++ b/waspc/src/Wasp/AppSpec/App/Client.hs @@ -16,6 +16,7 @@ data Client = Client { setupFn :: Maybe ExtImport, rootComponent :: Maybe ExtImport, -- We expect the base dir to start with a slash e.g. /client - baseDir :: Maybe String + baseDir :: Maybe String, + envValidationSchema :: Maybe ExtImport } deriving (Show, Eq, Data, Generic, FromJSON) diff --git a/waspc/src/Wasp/AppSpec/App/Server.hs b/waspc/src/Wasp/AppSpec/App/Server.hs index 89b9cee5e6..b7c3bc16e7 100644 --- a/waspc/src/Wasp/AppSpec/App/Server.hs +++ b/waspc/src/Wasp/AppSpec/App/Server.hs @@ -14,6 +14,7 @@ import Wasp.AppSpec.ExtImport (ExtImport) data Server = Server { setupFn :: Maybe ExtImport, - middlewareConfigFn :: Maybe ExtImport + middlewareConfigFn :: Maybe ExtImport, + envValidationSchema :: Maybe ExtImport } deriving (Show, Eq, Data, Generic, FromJSON) diff --git a/waspc/src/Wasp/Generator/EmailSenders.hs b/waspc/src/Wasp/Generator/EmailSenders.hs new file mode 100644 index 0000000000..ea804dd9c4 --- /dev/null +++ b/waspc/src/Wasp/Generator/EmailSenders.hs @@ -0,0 +1,23 @@ +module Wasp.Generator.EmailSenders + ( getEnabledEmailProvidersJson, + ) +where + +import Data.Aeson (KeyValue ((.=)), object) +import qualified Data.Aeson as Aeson +import qualified Wasp.AppSpec.App.EmailSender as AS.App.EmailSender + +getEnabledEmailProvidersJson :: AS.App.EmailSender.EmailSender -> Aeson.Value +getEnabledEmailProvidersJson emailSender = + object $ + makeProviderJson + <$> providersKeyAndName + where + providersKeyAndName = + [ ("isSmtpProviderEnabled", AS.App.EmailSender.SMTP), + ("isSendGridProviderEnabled", AS.App.EmailSender.SendGrid), + ("isMailgunProviderEnabled", AS.App.EmailSender.Mailgun), + ("isDummyProviderEnabled", AS.App.EmailSender.Dummy) + ] + makeProviderJson (key, name) = key .= (enabledEmailSenderName == name) + enabledEmailSenderName = AS.App.EmailSender.provider emailSender diff --git a/waspc/src/Wasp/Generator/SdkGenerator.hs b/waspc/src/Wasp/Generator/SdkGenerator.hs index 259d1f97e3..26906464c6 100644 --- a/waspc/src/Wasp/Generator/SdkGenerator.hs +++ b/waspc/src/Wasp/Generator/SdkGenerator.hs @@ -46,6 +46,7 @@ import qualified Wasp.Generator.SdkGenerator.Client.OperationsGenerator as Clien import Wasp.Generator.SdkGenerator.Client.RouterGenerator (genNewClientRouterApi) import qualified Wasp.Generator.SdkGenerator.Common as C import Wasp.Generator.SdkGenerator.CrudG (genCrud) +import Wasp.Generator.SdkGenerator.EnvValidation (depsRequiredByEnvValidation, genEnvValidation) import Wasp.Generator.SdkGenerator.Server.AuthG (genNewServerApi) import Wasp.Generator.SdkGenerator.Server.CrudG (genNewServerCrudApi) import Wasp.Generator.SdkGenerator.Server.EmailSenderG (depsRequiredByEmail, genNewEmailSenderApi) @@ -62,7 +63,6 @@ import Wasp.Generator.WebAppGenerator.Common reactRouterVersion, reactVersion, ) -import qualified Wasp.Generator.WebAppGenerator.Common as WebApp import qualified Wasp.Job as J import Wasp.Job.IO (readJobMessagesAndPrintThemPrefixed) import Wasp.Job.Process (runNodeCommandAsJob) @@ -99,7 +99,7 @@ genSdk spec = genFileCopy [relfile|client/test/index.ts|], genFileCopy [relfile|client/index.ts|], genFileCopy [relfile|dev/index.ts|], - genClientConfigFile, + genFileCopy [relfile|client/config.ts|], genServerConfigFile spec, genTsConfigJson, genServerUtils spec, @@ -125,6 +125,7 @@ genSdk spec = <++> genNewEmailSenderApi spec <++> genNewJobsApi spec <++> genNewClientRouterApi spec + <++> genEnvValidation spec where genFileCopy = return . C.mkTmplFd @@ -195,7 +196,6 @@ npmDepsForSdk spec = ("express", Server.expressVersionStr), ("mitt", "3.0.0"), ("react", show reactVersion), - ("lodash.merge", "^4.6.2"), ("react-router-dom", show reactRouterVersion), ("react-hook-form", "^7.45.4"), ("superjson", show superjsonVersion) @@ -217,7 +217,8 @@ npmDepsForSdk spec = -- These deps need to be installed in the SDK becasue when we run client tests, -- we are running them from the project root dir and PostCSS and Tailwind -- can't be resolved from WebApp node_modules, so we need to install them in the SDK. - ++ depsRequiredByTailwind spec, + ++ depsRequiredByTailwind spec + ++ depsRequiredByEnvValidation, N.devDependencies = AS.Dependency.fromList [ ("@tsconfig/node" <> majorNodeVersionStr, "latest"), @@ -246,18 +247,9 @@ genServerConfigFile spec = return $ C.mkTmplFdWithData relConfigFilePath tmplDat tmplData = object [ "isAuthEnabled" .= isAuthEnabled spec, - "databaseUrlEnvVarName" .= Db.databaseUrlEnvVarName, - "defaultClientUrl" .= WebApp.getDefaultDevClientUrl spec, - "defaultServerUrl" .= Server.defaultDevServerUrl, - "defaultServerPort" .= Server.defaultServerPort + "databaseUrlEnvVarName" .= Db.databaseUrlEnvVarName ] -genClientConfigFile :: Generator FileDraft -genClientConfigFile = return $ C.mkTmplFdWithData relConfigFilePath tmplData - where - relConfigFilePath = [relfile|client/config.ts|] - tmplData = object ["defaultServerUrl" .= Server.defaultDevServerUrl] - -- todo(filip): remove this duplication, we have almost the same thing in the -- ServerGenerator. genTsConfigJson :: Generator FileDraft diff --git a/waspc/src/Wasp/Generator/SdkGenerator/EmailSender/Providers.hs b/waspc/src/Wasp/Generator/SdkGenerator/EmailSender/Providers.hs index cea9734e70..528a550694 100644 --- a/waspc/src/Wasp/Generator/SdkGenerator/EmailSender/Providers.hs +++ b/waspc/src/Wasp/Generator/SdkGenerator/EmailSender/Providers.hs @@ -15,10 +15,7 @@ import qualified Wasp.SemanticVersion as SV data EmailSenderProvider = EmailSenderProvider { npmDependency :: Maybe AS.Dependency.Dependency, - setupFnFile :: Path' (Rel ProvidersDir) File', - -- We have to use explicit boolean keys in templates (e.g. "isSMTPProviderEnabled") so each - -- provider provides its own key which we pass to the template. - isEnabledKey :: String + setupFnFile :: Path' (Rel ProvidersDir) File' } deriving (Show, Eq) @@ -31,8 +28,7 @@ smtp :: EmailSenderProvider smtp = EmailSenderProvider { npmDependency = Just nodeMailerDependency, - setupFnFile = [relfile|smtp.ts|], - isEnabledKey = "isSmtpProviderUsed" + setupFnFile = [relfile|smtp.ts|] } where nodeMailerVersionRange :: SV.Range @@ -45,8 +41,7 @@ sendGrid :: EmailSenderProvider sendGrid = EmailSenderProvider { npmDependency = Just sendGridDependency, - setupFnFile = [relfile|sendgrid.ts|], - isEnabledKey = "isSendGridProviderUsed" + setupFnFile = [relfile|sendgrid.ts|] } where sendGridVersionRange :: SV.Range @@ -59,8 +54,7 @@ mailgun :: EmailSenderProvider mailgun = EmailSenderProvider { npmDependency = Just mailgunDependency, - setupFnFile = [relfile|mailgun.ts|], - isEnabledKey = "isMailgunProviderUsed" + setupFnFile = [relfile|mailgun.ts|] } where mailgunVersionRange :: SV.Range @@ -73,6 +67,5 @@ dummy :: EmailSenderProvider dummy = EmailSenderProvider { npmDependency = Nothing, - setupFnFile = [relfile|dummy.ts|], - isEnabledKey = "isDummyProviderUsed" + setupFnFile = [relfile|dummy.ts|] } diff --git a/waspc/src/Wasp/Generator/SdkGenerator/EnvValidation.hs b/waspc/src/Wasp/Generator/SdkGenerator/EnvValidation.hs new file mode 100644 index 0000000000..d6d5c163d8 --- /dev/null +++ b/waspc/src/Wasp/Generator/SdkGenerator/EnvValidation.hs @@ -0,0 +1,75 @@ +module Wasp.Generator.SdkGenerator.EnvValidation + ( genEnvValidation, + depsRequiredByEnvValidation, + ) +where + +import Data.Aeson (KeyValue ((.=)), object) +import Data.Maybe (isJust) +import StrongPath (relfile) +import Wasp.AppSpec (AppSpec) +import qualified Wasp.AppSpec.App as AS.App +import qualified Wasp.AppSpec.App.Client as AS.App.Client +import qualified Wasp.AppSpec.App.Dependency as AS.Dependency +import qualified Wasp.AppSpec.App.Server as AS.App.Server +import Wasp.AppSpec.Valid (getApp) +import qualified Wasp.Generator.AuthProviders as AuthProviders +import qualified Wasp.Generator.EmailSenders as EmailSenders +import Wasp.Generator.FileDraft (FileDraft) +import qualified Wasp.Generator.JsImport as GJI +import Wasp.Generator.Monad (Generator) +import qualified Wasp.Generator.SdkGenerator.Common as C +import Wasp.Generator.SdkGenerator.Server.OperationsGenerator (extImportToJsImport) +import qualified Wasp.Generator.ServerGenerator.Common as Server +import qualified Wasp.Generator.WebAppGenerator.Common as WebApp +import qualified Wasp.Project.Db as Db + +genEnvValidation :: AppSpec -> Generator [FileDraft] +genEnvValidation spec = + sequence + [ genServerEnv spec, + genClientEnv spec, + genFileCopy [relfile|env/index.ts|], + genFileCopy [relfile|env/validation.ts|] + ] + where + genFileCopy = return . C.mkTmplFd + +genServerEnv :: AppSpec -> Generator FileDraft +genServerEnv spec = return $ C.mkTmplFdWithData tmplPath tmplData + where + tmplPath = [relfile|server/env.ts|] + tmplData = + object + [ "isAuthEnabled" .= isJust maybeAuth, + "databaseUrlEnvVarName" .= Db.databaseUrlEnvVarName, + "defaultClientUrl" .= WebApp.getDefaultDevClientUrl spec, + "defaultServerUrl" .= Server.defaultDevServerUrl, + "defaultServerPort" .= Server.defaultServerPort, + "enabledAuthProviders" .= (AuthProviders.getEnabledAuthProvidersJson <$> maybeAuth), + "isEmailSenderEnabled" .= isJust maybeEmailSender, + "enabledEmailSenders" .= (EmailSenders.getEnabledEmailProvidersJson <$> maybeEmailSender), + "envValidationSchema" .= GJI.jsImportToImportJson (extImportToJsImport <$> maybeEnvValidationSchema) + ] + maybeAuth = AS.App.auth app + maybeEmailSender = AS.App.emailSender app + maybeEnvValidationSchema = AS.App.server app >>= AS.App.Server.envValidationSchema + app = snd $ getApp spec + +genClientEnv :: AppSpec -> Generator FileDraft +genClientEnv spec = return $ C.mkTmplFdWithData tmplPath tmplData + where + tmplPath = [relfile|client/env.ts|] + tmplData = + object + [ "defaultServerUrl" .= Server.defaultDevServerUrl, + "envValidationSchema" .= GJI.jsImportToImportJson (extImportToJsImport <$> maybeEnvValidationSchema) + ] + maybeEnvValidationSchema = AS.App.client app >>= AS.App.Client.envValidationSchema + app = snd $ getApp spec + +depsRequiredByEnvValidation :: [AS.Dependency.Dependency] +depsRequiredByEnvValidation = + AS.Dependency.fromList + [ ("zod", "^3.23.8") + ] diff --git a/waspc/src/Wasp/Generator/SdkGenerator/Server/EmailSenderG.hs b/waspc/src/Wasp/Generator/SdkGenerator/Server/EmailSenderG.hs index fa6cb2b315..87effec2b9 100644 --- a/waspc/src/Wasp/Generator/SdkGenerator/Server/EmailSenderG.hs +++ b/waspc/src/Wasp/Generator/SdkGenerator/Server/EmailSenderG.hs @@ -1,9 +1,11 @@ -module Wasp.Generator.SdkGenerator.Server.EmailSenderG where +module Wasp.Generator.SdkGenerator.Server.EmailSenderG + ( genNewEmailSenderApi, + depsRequiredByEmail, + ) +where import Data.Aeson (object, (.=)) -import qualified Data.Aeson as Aeson import Data.Maybe (fromMaybe, isJust, maybeToList) -import qualified Data.Text import StrongPath (File', Path', Rel, relfile, ()) import Wasp.AppSpec (AppSpec) import qualified Wasp.AppSpec.App as AS.App @@ -11,6 +13,7 @@ import qualified Wasp.AppSpec.App.Dependency as AS.Dependency import Wasp.AppSpec.App.EmailSender (EmailSender) import qualified Wasp.AppSpec.App.EmailSender as AS.EmailSender import Wasp.AppSpec.Valid (getApp) +import qualified Wasp.Generator.EmailSenders as EmailSenders import Wasp.Generator.FileDraft (FileDraft) import Wasp.Generator.Monad (Generator) import qualified Wasp.Generator.SdkGenerator.Common as C @@ -32,7 +35,7 @@ genIndex :: EmailSender -> Generator FileDraft genIndex email = return $ C.mkTmplFdWithData tmplPath tmplData where tmplPath = [relfile|server/email/index.ts|] - tmplData = getEmailProvidersJson email + tmplData = EmailSenders.getEnabledEmailProvidersJson email genCore :: EmailSender -> Generator [FileDraft] genCore email = @@ -47,7 +50,7 @@ genCoreIndex :: EmailSender -> Generator FileDraft genCoreIndex email = return $ C.mkTmplFdWithData tmplPath tmplData where tmplPath = [relfile|server/email/core/index.ts|] - tmplData = getEmailProvidersJson email + tmplData = EmailSenders.getEnabledEmailProvidersJson email genCoreTypes :: EmailSender -> Generator FileDraft genCoreTypes email = return $ C.mkTmplFdWithData tmplPath tmplData @@ -95,14 +98,6 @@ depsRequiredByEmail spec = maybeToList maybeNpmDepedency maybeProvider = getEmailSenderProvider <$> (AS.App.emailSender . snd . getApp $ spec) maybeNpmDepedency = maybeProvider >>= Providers.npmDependency -getEmailProvidersJson :: EmailSender -> Aeson.Value -getEmailProvidersJson email = - object [isEnabledKey .= True] - where - provider :: Providers.EmailSenderProvider - provider = getEmailSenderProvider email - isEnabledKey = Data.Text.pack $ Providers.isEnabledKey provider - getEmailSenderProvider :: EmailSender -> Providers.EmailSenderProvider getEmailSenderProvider email = case AS.EmailSender.provider email of AS.EmailSender.SMTP -> Providers.smtp diff --git a/waspc/src/Wasp/Generator/SdkGenerator/Server/OAuthG.hs b/waspc/src/Wasp/Generator/SdkGenerator/Server/OAuthG.hs index fb533e22f1..0050aff479 100644 --- a/waspc/src/Wasp/Generator/SdkGenerator/Server/OAuthG.hs +++ b/waspc/src/Wasp/Generator/SdkGenerator/Server/OAuthG.hs @@ -35,7 +35,6 @@ genOAuth auth sequence [ genIndexTs auth, genRedirectHelper, - genFileCopy $ oauthDirInSdkTemplatesDir [relfile|env.ts|], genFileCopy $ oauthDirInSdkTemplatesDir [relfile|oneTimeCode.ts|], genFileCopy $ oauthDirInSdkTemplatesDir [relfile|provider.ts|] ] diff --git a/waspc/src/Wasp/Generator/ServerGenerator.hs b/waspc/src/Wasp/Generator/ServerGenerator.hs index 269e878336..e40797511c 100644 --- a/waspc/src/Wasp/Generator/ServerGenerator.hs +++ b/waspc/src/Wasp/Generator/ServerGenerator.hs @@ -75,7 +75,6 @@ genServer spec = <++> genSrcDir spec <++> genDotEnv spec <++> genJobs spec - <++> genEnvValidationScript <++> genApis spec <++> genCrud spec where @@ -252,12 +251,6 @@ genRoutesIndex spec = operationsRouteInRootRouter :: String operationsRouteInRootRouter = "operations" -genEnvValidationScript :: Generator [FileDraft] -genEnvValidationScript = - return - [ C.mkTmplFd [relfile|scripts/validate-env.mjs|] - ] - genMiddleware :: AppSpec -> Generator [FileDraft] genMiddleware spec = sequence diff --git a/waspc/src/Wasp/Generator/WebAppGenerator.hs b/waspc/src/Wasp/Generator/WebAppGenerator.hs index e1f4b481ed..2f896c4f4c 100644 --- a/waspc/src/Wasp/Generator/WebAppGenerator.hs +++ b/waspc/src/Wasp/Generator/WebAppGenerator.hs @@ -76,7 +76,6 @@ genWebApp spec = do <++> genSrcDir spec <++> genPublicDir spec <++> genDotEnv spec - <++> genEnvValidationScript where genFileCopy = return . C.mkTmplFd @@ -138,8 +137,6 @@ npmDepsForWasp _spec = ("@types/react", "^18.0.37"), ("@types/react-dom", "^18.0.11"), ("@vitejs/plugin-react", "^4.2.1"), - -- NOTE: used in the validate-env.mjs script - ("dotenv", "^16.0.3"), -- NOTE: Make sure to bump the version of the tsconfig -- when updating Vite or React versions ("@tsconfig/vite-react", "^2.0.0") @@ -227,12 +224,6 @@ getIndexTs spec = relPathToWebAppSrcDir :: Path Posix (Rel importLocation) (Dir C.WebAppSrcDir) relPathToWebAppSrcDir = [reldirP|./|] -genEnvValidationScript :: Generator [FileDraft] -genEnvValidationScript = - return - [ C.mkTmplFd [relfile|scripts/validate-env.mjs|] - ] - -- todo(filip): Take care of this as well genViteConfig :: AppSpec -> Generator FileDraft genViteConfig spec = return $ C.mkTmplFdWithData tmplFile tmplData diff --git a/waspc/test/AnalyzerTest.hs b/waspc/test/AnalyzerTest.hs index 6b145d7478..07e779d758 100644 --- a/waspc/test/AnalyzerTest.hs +++ b/waspc/test/AnalyzerTest.hs @@ -164,7 +164,8 @@ spec_Analyzer = do ExtImport (ExtImportField "setupServer") (fromJust $ SP.parseRelFileP "bar.js"), - Server.middlewareConfigFn = Nothing + Server.middlewareConfigFn = Nothing, + Server.envValidationSchema = Nothing }, App.client = Just @@ -175,7 +176,8 @@ spec_Analyzer = do Client.rootComponent = Just $ ExtImport (ExtImportField "App") (fromJust $ SP.parseRelFileP "App.jsx"), - Client.baseDir = Just "/" + Client.baseDir = Just "/", + Client.envValidationSchema = Nothing }, App.db = Just diff --git a/waspc/waspc.cabal b/waspc/waspc.cabal index f428c957a8..2d22d2fd79 100644 --- a/waspc/waspc.cabal +++ b/waspc/waspc.cabal @@ -41,7 +41,6 @@ data-files: Generator/templates/**/*.js Generator/templates/**/*.jsx Generator/templates/**/*.tsx - Generator/templates/**/*.mjs Generator/templates/**/*.png Cli/bash-completion Cli/templates/**/*.css @@ -72,6 +71,11 @@ data-files: packages/studio/dist/**/*.css packages/studio/package.json packages/studio/package-lock.json + packages/wasp-config/dist/**/*.js + packages/wasp-config/dist/**/*.d.ts + packages/wasp-config/dist/**/*.map + packages/wasp-config/package.json + packages/wasp-config/package-lock.json data-dir: data/ source-repository head @@ -281,6 +285,7 @@ library Wasp.Generator.DbGenerator.Jobs Wasp.Generator.DbGenerator.Operations Wasp.Generator.DockerGenerator + Wasp.Generator.EmailSenders Wasp.Generator.ExternalCodeGenerator.Common Wasp.Generator.ExternalConfig.Common Wasp.Generator.ExternalConfig.PackageJson @@ -312,6 +317,7 @@ library Wasp.Generator.SdkGenerator.Common Wasp.Generator.SdkGenerator.CrudG Wasp.Generator.SdkGenerator.EmailSender.Providers + Wasp.Generator.SdkGenerator.EnvValidation Wasp.Generator.SdkGenerator.Server.AuthG Wasp.Generator.SdkGenerator.Server.OAuthG Wasp.Generator.SdkGenerator.Server.CrudG diff --git a/web/docs/project/env-vars.md b/web/docs/project/env-vars.md index a0ac725f74..661e21fc7b 100644 --- a/web/docs/project/env-vars.md +++ b/web/docs/project/env-vars.md @@ -218,13 +218,158 @@ We talk about how to define env vars for each deployment option in the [deployme ## Custom Env Var Validations -TODO: when the Zod validation PRs are merged, describe how users can define their own validations. +If your code requires some environment variables, you usually want to ensure that they are correctly defined. In Wasp, you can define your environment variables validation by defining a [Zod object schema](https://zod.dev/?id=basic-usage) and telling Wasp to use it. + +:::info What is Zod? + +[Zod](https://zod.dev/) is a library that lets you define what you expect from your data. For example, you can use Zod to define that: + +- A value should be a string that's a valid email address. +- A value should be a number between 0 and 100. +- ... and much more. + +::: + +Take a look at an example of defining env vars validation: + + + + +```js title="src/env.js" +import * as z from 'zod' + +import { defineEnvValidationSchema } from 'wasp/env' + +export const serverEnvValidationSchema = defineEnvValidationSchema( + z.object({ + STRIPE_API_KEY: z.string({ + required_error: 'STRIPE_API_KEY is required.', + }), + }) +) + +export const clientEnvValidationSchema = defineEnvValidationSchema( + z.object({ + REACT_APP_NAME: z.string().default('TODO App'), + }) +) +``` + + + + +```ts title="src/env.ts" +import * as z from 'zod' + +import { defineEnvValidationSchema } from 'wasp/env' + +export const serverEnvValidationSchema = defineEnvValidationSchema( + z.object({ + STRIPE_API_KEY: z.string({ + required_error: 'STRIPE_API_KEY is required.', + }), + }) +) + +export const clientEnvValidationSchema = defineEnvValidationSchema( + z.object({ + REACT_APP_NAME: z.string().default('TODO App'), + }) +) +``` + +The `defineEnvValidationSchema` function ensures your Zod schema is type-checked. + + + + +```wasp title="main.wasp" +app myApp { + ... + client: { + envValidationSchema: import { clientEnvValidationSchema } from "@src/env", + }, + server: { + envValidationSchema: import { serverEnvValidationSchema } from "@src/env", + }, +} +``` + +You defined schemas for both the client and the server env vars and told Wasp to use them. Wasp merges your env validation schemas with the built-in env vars validation schemas when it validates the `process.env` object on the server and the `import.meta.env` object on the client. + +This means you can use the `env` object to access **your env vars** like this: + +```ts title="src/stripe.ts" +import { env } from 'wasp/server' + +const stripeApiKey = env.STRIPE_API_KEY +``` + +Read more about the env object in the [API Reference](#api-reference). ## API Reference +There are **Wasp-defined** and **user-defined** env vars. Wasp already comes with built-in validation for Wasp-defined env vars. For your env vars, you can define your own validation. + ### Client Env Vars -Access client env vars in your client code using the `env` object like this: +#### User-defined env vars validation + +You can define your client env vars validation like this: + + + + +```js title="src/env.js" +import * as z from 'zod' + +import { defineEnvValidationSchema } from 'wasp/env' + +export const envValidationSchema = defineEnvValidationSchema( + z.object({ + REACT_APP_ANALYTICS_ID: z.string({ + required_error: 'REACT_APP_ANALYTICS_ID is required.', + }), + }) +) +``` + + + + +```ts title="src/env.ts" +import * as z from 'zod' + +import { defineEnvValidationSchema } from 'wasp/env' + +export const envValidationSchema = defineEnvValidationSchema( + z.object({ + REACT_APP_ANALYTICS_ID: z.string({ + required_error: 'REACT_APP_ANALYTICS_ID is required.', + }), + }) +) +``` + +The `defineEnvValidationSchema` function ensures your Zod schema is type-checked. + + + + +```wasp title="main.wasp" +app myApp { + ... + client: { + envValidationSchema: import { envValidationSchema } from "@src/env", + }, +} +``` + +Wasp merges your env validation schemas with the built-in env vars validation schemas when it validates the `import.meta.env` object. + +#### Accessing env vars in client code + +You can access both **Wasp-defined** and **user-defined** client env vars in your client code using the `env` object: @@ -232,7 +377,11 @@ Access client env vars in your client code using the `env` object like this: ```js title="src/App.js" import { env } from 'wasp/client' -console.log(env.REACT_APP_SOME_VAR_NAME) +// Wasp-defined +const apiUrl = env.REACT_APP_API_URL + +// User-defined +const analyticsId = env.REACT_APP_ANALYTICS_ID ``` @@ -241,45 +390,105 @@ console.log(env.REACT_APP_SOME_VAR_NAME) ```ts title="src/App.ts" import { env } from 'wasp/client' -console.log(env.REACT_APP_SOME_VAR_NAME) +// Wasp-defined +const apiUrl = env.REACT_APP_API_URL + +// User-defined +const analyticsId = env.REACT_APP_ANALYTICS_ID ``` -The `env` object is a validated object that Wasp provides to access client env vars. +You can use `import.meta.env.REACT_APP_SOME_VAR_NAME` directly in your code. We don't recommend this since `import.meta.env` isn't validated and missing env vars can cause runtime errors. -You can use `import.meta.env.REACT_APP_SOME_VAR_NAME` directly in your code, but it's not recommended because it's not validated and can lead to runtime errors if the env var is not defined. +### Server Env Vars - +#### User-defined env vars validation -### Server Env Vars +You can define your env vars validation like this: + + + + +```js title="src/env.js" +import * as z from 'zod' + +import { defineEnvValidationSchema } from 'wasp/env' -Access server env vars in your server code using the `env` object like this: +export const envValidationSchema = defineEnvValidationSchema( + z.object({ + STRIPE_API_KEY: z.string({ + required_error: 'STRIPE_API_KEY is required.', + }), + }) +) +``` + + + + +```ts title="src/env.ts" +import * as z from 'zod' + +import { defineEnvValidationSchema } from 'wasp/env' + +export const envValidationSchema = defineEnvValidationSchema( + z.object({ + STRIPE_API_KEY: z.string({ + required_error: 'STRIPE_API_KEY is required.', + }), + }) +) +``` + +The `defineEnvValidationSchema` function ensures your Zod schema is type-checked. + + + + +```wasp title="main.wasp" +app myApp { + ... + server: { + envValidationSchema: import { envValidationSchema } from "@src/env", + }, +} +``` + +Wasp merges your env validation schemas with the built-in env vars validation schemas when it validates the `process.env` object. + +#### Accessing env vars in server code + +You can access both **Wasp-defined** and **user-defined** client env vars in your client code using the `env` object: -```js title="src/App.js" +```js title="src/stripe.js" import { env } from 'wasp/server' -console.log(env.SOME_SECRET) +// Wasp-defined +const serverUrl = env.WASP_SERVER_URL + +// User-defined +const stripeApiKey = env.STRIPE_API_KEY ``` -```ts title="src/App.ts" +```ts title="src/stripe.ts" import { env } from 'wasp/server' -console.log(env.SOME_SECRET) +// Wasp-defined +const serverUrl = env.WASP_SERVER_URL + +// User-defined +const stripeApiKey = env.STRIPE_API_KEY ``` -The `env` object is a validated object that Wasp provides to access server env vars. - -You can use `process.env.SOME_SECRET` directly in your code, but it's not recommended because it's not validated and can lead to runtime errors if the env var is not defined. - - +You can use `process.env.SOME_SECRET` directly in your code. We don't recommend this since `process.env` isn't validated and missing env vars can cause runtime errors.