Skip to content

Commit

Permalink
config: added prettier.config.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
warmachine028 committed Sep 12, 2024
1 parent c85d363 commit b44e9ff
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 33 deletions.
1 change: 0 additions & 1 deletion client/.npmcheckrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"@uploadthing/react",
"arctic",
"ky",
"prettier",
"prettier-plugin-packagejson",
"prettier-plugin-tailwindcss",
"react-cropper",
Expand Down
1 change: 1 addition & 0 deletions client/next.config.mts → client/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ export default {
},
serverExternalPackages: ['@node-rs/argon2']
} satisfies Config

12 changes: 0 additions & 12 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"tailwind-merge": "^2.5.2",
"tailwindcss-animate": "^1.0.7",
"uploadthing": "^6.13.2",
"ws": "^8.18.0",
"zod": "^3.24.0-canary.20240701T200529"
},
"devDependencies": {
Expand All @@ -56,7 +55,6 @@
"@types/eslint-config-prettier": "^6.11.3",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/ws": "^8.5.12",
"eslint": "^9.10.0",
"eslint-config-next": "15.0.0-rc.0",
"eslint-config-prettier": "^9.1.0",
Expand Down Expand Up @@ -103,4 +101,4 @@
"start": "next start"
},
"version": "0.1.0"
}
}
19 changes: 19 additions & 0 deletions client/prettier.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @see https://prettier.io/docs/en/configuration.html
* @type {import("prettier").Config}
*/
import type { Config } from 'prettier'
// prettier.config.js, .prettierrc.js, prettier.config.cjs, or .prettierrc.cjs

export default {
arrowParens: 'always',
bracketSpacing: true,
endOfLine: 'lf',
plugins: ['prettier-plugin-packagejson', 'prettier-plugin-tailwindcss'],
printWidth: 120,
semi: false,
singleQuote: true,
tabWidth: 4,
trailingComma: 'none',
useTabs: true
} satisfies Config
28 changes: 13 additions & 15 deletions client/src/lib/prisma.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
//? https://github.com/prisma/prisma/discussions/23533#discussioncomment-8838160
import { PrismaNeon } from '@prisma/adapter-neon'
import { Pool, neonConfig } from '@neondatabase/serverless'
import { Pool } from '@neondatabase/serverless'
import { PrismaClient } from '@prisma/client'
import { withOptimize } from '@prisma/extension-optimize'
import { withAccelerate } from '@prisma/extension-accelerate'
import { withPulse } from '@prisma/extension-pulse'
// import ws from 'ws'
import { withOptimize } from '@prisma/extension-optimize'
import { withPulse } from '@prisma/extension-pulse/node'

// neonConfig.webSocketConstructor = ws
const neon = new Pool({ connectionString: process.env.DATABASE_PRISMA_URL }) // or process.env.POSTGRES_PRISMS_URL
const adapter = new PrismaNeon(neon)
const prismaClientSingleton = () =>
new PrismaClient({ adapter })
.$extends(withAccelerate())
// .$extends(
// withPulse({
// apiKey: process.env.PULSE_API_KEY as string
// })
// )
// .$extends(
// withOptimize({
// apiKey: process.env.OPTIMIZE_API_KEY as string
// })
// )
.$extends(
withPulse({
apiKey: process.env.PULSE_API_KEY as string
})
)
.$extends(
withOptimize({
apiKey: process.env.OPTIMIZE_API_KEY as string
})
)

declare global {
var prismaGlobal: undefined | ReturnType<typeof prismaClientSingleton>
Expand Down
4 changes: 2 additions & 2 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/tsconfig.json",
"compilerOptions": {
"target": "ESNext",
"customConditions": ["workerd"], // or "node"
"customConditions": ["node"], // or "node"
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand All @@ -24,6 +24,6 @@
"@/*": ["./src/*"]
}
},
"include": ["**/*.ts", "**/*.tsx", "next-env.d.ts", "next.config.mts", ".next/types/**/*.ts"],
"include": ["**/*.ts", "**/*.tsx", "next-env.d.ts", "next.config.ts", ".next/types/**/*.ts"],
"exclude": ["node_modules", "future"]
}

0 comments on commit b44e9ff

Please sign in to comment.