mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-06-22 04:11:32 +10:00
feat: upgrade to nuxt 3.16
This commit is contained in:
@@ -0,0 +1,54 @@
|
|||||||
|
// thanks https://github.com/prisma/prisma/issues/26565#issuecomment-2777915354
|
||||||
|
|
||||||
|
import fs from "fs/promises";
|
||||||
|
import path from "path";
|
||||||
|
import { fileURLToPath } from "url";
|
||||||
|
|
||||||
|
async function replaceInFiles(dir) {
|
||||||
|
const files = await fs.readdir(dir, { withFileTypes: true });
|
||||||
|
|
||||||
|
for (const file of files) {
|
||||||
|
const fullPath = path.join(dir, file.name);
|
||||||
|
// Skip directories
|
||||||
|
if (!file.isDirectory()) {
|
||||||
|
if (
|
||||||
|
file.name.endsWith(".js") ||
|
||||||
|
file.name.endsWith(".ts") ||
|
||||||
|
file.name.endsWith(".mjs")
|
||||||
|
) {
|
||||||
|
let content = await fs.readFile(fullPath, "utf8");
|
||||||
|
if (content.includes(".prisma")) {
|
||||||
|
const isWindows = content.includes("\r\n");
|
||||||
|
const lineEnding = isWindows ? "\r\n" : "\n";
|
||||||
|
|
||||||
|
content = content
|
||||||
|
.split(/\r?\n/)
|
||||||
|
.map((line) => line.replace(/\.prisma/g, "_prisma"))
|
||||||
|
.join(lineEnding);
|
||||||
|
|
||||||
|
await fs.writeFile(fullPath, content, "utf8");
|
||||||
|
console.log(`Modified: ${fullPath}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
const __dirname = path.dirname(__filename);
|
||||||
|
|
||||||
|
const oldPath = path.join(__dirname, "../node_modules/.prisma");
|
||||||
|
const newPath = path.join(__dirname, "../node_modules/_prisma");
|
||||||
|
try {
|
||||||
|
await fs.rename(oldPath, newPath);
|
||||||
|
console.log("Directory renamed from .prisma to _prisma");
|
||||||
|
} catch (err) {
|
||||||
|
console.log("Directory .prisma does not exist or has already been renamed");
|
||||||
|
}
|
||||||
|
|
||||||
|
await replaceInFiles(path.join(__dirname, "../node_modules/@prisma/client"));
|
||||||
|
console.log("Done! --- prisma!!!, replaced .prisma with _prisma");
|
||||||
|
}
|
||||||
|
|
||||||
|
main().catch((err) => console.error(err));
|
||||||
+2
-2
@@ -8,7 +8,7 @@
|
|||||||
"dev": "nuxt dev",
|
"dev": "nuxt dev",
|
||||||
"generate": "nuxt generate",
|
"generate": "nuxt generate",
|
||||||
"preview": "nuxt preview",
|
"preview": "nuxt preview",
|
||||||
"postinstall": "prisma generate && nuxt prepare",
|
"postinstall": "prisma generate && nuxt prepare && node build/fix-prisma.js",
|
||||||
"typecheck": "nuxt typecheck"
|
"typecheck": "nuxt typecheck"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
"lru-cache": "^11.1.0",
|
"lru-cache": "^11.1.0",
|
||||||
"luxon": "^3.6.1",
|
"luxon": "^3.6.1",
|
||||||
"micromark": "^4.0.1",
|
"micromark": "^4.0.1",
|
||||||
"nuxt": "3.15.4",
|
"nuxt": "^3.16.2",
|
||||||
"nuxt-security": "2.2.0",
|
"nuxt-security": "2.2.0",
|
||||||
"prisma": "^6.5.0",
|
"prisma": "^6.5.0",
|
||||||
"sanitize-filename": "^1.6.3",
|
"sanitize-filename": "^1.6.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user