From 935e51966278581d157290b8ab64531819f3a9d0 Mon Sep 17 00:00:00 2001 From: bagasbanuna Date: Tue, 3 Mar 2026 11:55:25 +0800 Subject: [PATCH 1/2] chore(release): 1.6.3 --- CHANGELOG.md | 2 ++ package.json | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7959c994..d871ca16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. +## [1.6.3](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.6.2...v1.6.3) (2026-03-03) + ## [1.6.2](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.6.1...v1.6.2) (2026-02-25) ## [1.6.1](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.6.0...v1.6.1) (2026-02-25) diff --git a/package.json b/package.json index 51b8528a..f7fb898b 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,16 @@ { "name": "hipmi", - "version": "1.6.2", + "version": "1.6.3", "private": true, "prisma": { "seed": "bun prisma/seed.ts" }, "scripts": { "dev": "next dev --experimental-https", - "build": "next build", - "build:dev": "next build", + "build": "prisma generate && next build", + "build:dev": "prisma generate && next build", "start": "next start", + "postbuild": "node scripts/postbuild.js", "lint": "next lint", "ver": "bunx commit-and-tag-version -- --prerelease" }, -- 2.49.1 From 250b7c5261e8a88c2d1d7b1a88dae711f7b4990a Mon Sep 17 00:00:00 2001 From: bagasbanuna Date: Tue, 3 Mar 2026 12:03:30 +0800 Subject: [PATCH 2/2] Fix Prisma --- next.config.js | 8 ++++++++ scripts/postbuild.js | 41 +++++++++++++++++++++++++++++++++++++++++ src/lib/prisma.ts | 10 ++++++++++ 3 files changed, 59 insertions(+) create mode 100644 scripts/postbuild.js diff --git a/next.config.js b/next.config.js index 438386a8..40c379a2 100644 --- a/next.config.js +++ b/next.config.js @@ -3,12 +3,20 @@ const nextConfig = { reactStrictMode: false, experimental: { serverActions: true, + serverComponentsExternalPackages: ['@prisma/client'], }, output: "standalone", staticPageGenerationTimeout: 180, // tingkatkan menjadi 3 menit eslint: { ignoreDuringBuilds: true, }, + webpack: (config, { isServer }) => { + if (isServer) { + config.externals = config.externals || []; + config.externals.push('@prisma/client'); + } + return config; + }, // async headers() { // return [ // { diff --git a/scripts/postbuild.js b/scripts/postbuild.js new file mode 100644 index 00000000..adb56ed0 --- /dev/null +++ b/scripts/postbuild.js @@ -0,0 +1,41 @@ +const fs = require('fs'); +const path = require('path'); + +const standaloneDir = path.join(__dirname, '../.next/standalone'); +const prismaDir = path.join(__dirname, '../node_modules/.prisma'); + +console.log('🚀 Running postbuild script...'); + +// Copy Prisma binaries ke standalone output +if (fs.existsSync(prismaDir)) { + const dest = path.join(standaloneDir, 'node_modules/.prisma'); + fs.mkdirSync(path.dirname(dest), { recursive: true }); + fs.cpSync(prismaDir, dest, { recursive: true }); + console.log('✓ Prisma binaries copied to standalone output'); +} else { + console.warn('⚠ Prisma binaries directory not found, skipping...'); +} + +// Copy schema.prisma jika diperlukan +const schemaSrc = path.join(__dirname, '../prisma/schema.prisma'); +const schemaDest = path.join(standaloneDir, 'prisma/schema.prisma'); +if (fs.existsSync(schemaSrc)) { + fs.mkdirSync(path.dirname(schemaDest), { recursive: true }); + fs.copyFileSync(schemaSrc, schemaDest); + console.log('✓ schema.prisma copied to standalone output'); +} else { + console.warn('⚠ schema.prisma not found, skipping...'); +} + +// Copy prisma client dari node_modules/@prisma/client +const prismaClientSrc = path.join(__dirname, '../node_modules/@prisma/client'); +const prismaClientDest = path.join(standaloneDir, 'node_modules/@prisma/client'); +if (fs.existsSync(prismaClientSrc)) { + fs.mkdirSync(path.dirname(prismaClientDest), { recursive: true }); + fs.cpSync(prismaClientSrc, prismaClientDest, { recursive: true }); + console.log('✓ @prisma/client copied to standalone output'); +} else { + console.warn('⚠ @prisma/client not found, skipping...'); +} + +console.log('✅ Postbuild script completed!'); diff --git a/src/lib/prisma.ts b/src/lib/prisma.ts index bf87ef84..ac62c007 100644 --- a/src/lib/prisma.ts +++ b/src/lib/prisma.ts @@ -12,11 +12,21 @@ if (process.env.NODE_ENV === "production") { prisma = new PrismaClient({ // Reduce logging in production to improve performance log: ['error', 'warn'], + datasources: { + db: { + url: process.env.DATABASE_URL, + }, + }, }); } else { if (!global.prisma) { global.prisma = new PrismaClient({ log: ['error', 'warn', 'info', 'query'], // More verbose logging in development + datasources: { + db: { + url: process.env.DATABASE_URL, + }, + }, }); } prisma = global.prisma; -- 2.49.1