From df7a1328db18ca03c117c984a5c1d143257595a2 Mon Sep 17 00:00:00 2001 From: Kevin De Porre Date: Wed, 11 Dec 2024 16:46:47 +0100 Subject: [PATCH] Formatting --- examples/proxy-auth/next.config.js | 2 +- examples/proxy-auth/package.json | 1 + examples/proxy-auth/sst.config.ts | 26 ++++++++++++++++---------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/examples/proxy-auth/next.config.js b/examples/proxy-auth/next.config.js index 8f3f94042e..ea360261b5 100644 --- a/examples/proxy-auth/next.config.js +++ b/examples/proxy-auth/next.config.js @@ -4,4 +4,4 @@ const config = { }, } -export default config \ No newline at end of file +export default config diff --git a/examples/proxy-auth/package.json b/examples/proxy-auth/package.json index 67f01dc3b7..d8316d9a90 100644 --- a/examples/proxy-auth/package.json +++ b/examples/proxy-auth/package.json @@ -11,6 +11,7 @@ "build": "next build", "db:migrate": "dotenv -e ../../.env.dev -- pnpm exec pg-migrations apply --directory ./db/migrations", "dev": "next dev --turbo -p 5173", + "format": "eslint . --fix", "start": "next start", "stylecheck": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "typecheck": "tsc --noEmit" diff --git a/examples/proxy-auth/sst.config.ts b/examples/proxy-auth/sst.config.ts index badaa7f6fc..b8f95eb246 100644 --- a/examples/proxy-auth/sst.config.ts +++ b/examples/proxy-auth/sst.config.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line @typescript-eslint/triple-slash-reference /// import { execSync } from "child_process" @@ -6,14 +7,14 @@ const isProduction = (stage: string) => stage.toLowerCase() === `production` export default $config({ app(input) { return { - name: "proxy-auth", - removal: input?.stage === "production" ? "retain" : "remove", - protect: ["production"].includes(input?.stage), - home: "aws", + name: `proxy-auth`, + removal: input?.stage === `production` ? `retain` : `remove`, + protect: [`production`].includes(input?.stage), + home: `aws`, providers: { cloudflare: `5.42.0`, aws: { version: `6.57.0`, region: `eu-west-1` }, - postgresql: "3.14.0", + postgresql: `3.14.0`, }, } }, @@ -22,21 +23,26 @@ export default $config({ throw new Error( `Env variables ELECTRIC_API and ELECTRIC_ADMIN_API must be set` ) - - if (!process.env.EXAMPLES_DATABASE_HOST || !process.env.EXAMPLES_DATABASE_PASSWORD) { + + if ( + !process.env.EXAMPLES_DATABASE_HOST || + !process.env.EXAMPLES_DATABASE_PASSWORD + ) { throw new Error( `Env variables EXAMPLES_DATABASE_HOST and EXAMPLES_DATABASE_PASSWORD must be set` ) } - const provider = new postgresql.Provider("neon", { + const provider = new postgresql.Provider(`neon`, { host: process.env.EXAMPLES_DATABASE_HOST, database: `neondb`, username: `neondb_owner`, password: process.env.EXAMPLES_DATABASE_PASSWORD, }) - const dbName = isProduction($app.stage) ? `proxy-auth-production` : `proxy-auth-${$app.stage}` + const dbName = isProduction($app.stage) + ? `proxy-auth-production` + : `proxy-auth-${$app.stage}` const pg = new postgresql.Database(dbName, {}, { provider }) const pgUri = $interpolate`postgresql://${provider.username}:${provider.password}@${provider.host}/${pg.name}?sslmode=require` @@ -44,7 +50,7 @@ export default $config({ return addDatabaseToElectric(uri, `eu-west-1`) }) - const staticSite = new sst.aws.Nextjs("proxy-auth", { + const staticSite = new sst.aws.Nextjs(`proxy-auth`, { environment: { ELECTRIC_URL: process.env.ELECTRIC_API!, ELECTRIC_TOKEN: electricInfo.token,