Skip to content

Commit

Permalink
fix: page title & build command
Browse files Browse the repository at this point in the history
  • Loading branch information
ttttonyhe committed Dec 2, 2023
1 parent a217b6a commit c3ede54
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apps/analytics/components/layout/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function Layout({
}) {
const { dir } = useLocale()

const pageTitle = `ouorz-analytics${title && ` - ${title}`}`
const pageTitle = `ouorz-analytics${title ? ` - ${title}` : ""}`

return (
<>
Expand Down
22 changes: 12 additions & 10 deletions apps/analytics/lib/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,26 @@ const options = {
],
}

function logQuery(e) {
if (process.env.LOG_QUERY) {
console.log(
chalk.yellow(e.params),
"->",
e.query,
chalk.greenBright(`${e.duration}ms`)
)
}
}
// function logQuery(e) {
// if (process.env.LOG_QUERY) {
// console.log(
// chalk.yellow(e.params),
// "->",
// e.query,
// chalk.greenBright(`${e.duration}ms`)
// )
// }
// }

let prisma

if (process.env.NODE_ENV === "production") {
prisma = new PrismaClient(options).$extends(withAccelerate())
// prisma.$on("query", logQuery)
} else {
if (!global.prisma) {
global.prisma = new PrismaClient(options).$extends(withAccelerate())
// global.prisma.$on("query", logQuery)
}

prisma = global.prisma
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"build": "turbo run build --parallel",
"build:main": "turbo run @ouorz/main#build",
"build:analytics": "turbo run @ouorz/analytics#build",
"build:analytics:edge": "turbo run @ouorz/analytics#build:edge",
"build:twilight": "turbo run build --filter=./packages/twilight-*",
"build:twilight:ui": "turbo run @twilight-toolkit/ui#build",
"build:twilight:ui:storybook": "turbo run @twilight-toolkit/ui#build:storybook",
Expand Down
13 changes: 13 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@
"MAXMIND_LICENSE_KEY"
]
},
"@ouorz/analytics#build:edge": {
"dependsOn": [
"^build-edge"
],
"outputs": [
".next/**"
],
"env": [
"DATABASE_URL",
"HASH_SALT",
"MAXMIND_LICENSE_KEY"
]
},
"test": {
"dependsOn": [
"^build"
Expand Down

0 comments on commit c3ede54

Please sign in to comment.