From d612ea966875aac39567471b30e9e4fde5cdcbc0 Mon Sep 17 00:00:00 2001 From: Holly Date: Wed, 8 Jan 2025 14:50:10 +0000 Subject: [PATCH] WIP: Bun changes --- bun.lockb | Bin 68587 -> 70383 bytes controllers/AccountController.ts | 4 ++-- controllers/Controller.ts | 19 +++++++++---------- controllers/HomeController.ts | 7 ++----- index.ts | 4 +--- objects/Database.ts | 2 +- objects/HashFS.ts | 4 ++-- objects/RequestCtx.ts | 2 +- objects/Session.ts | 2 +- package.json | 2 +- services/UserService.ts | 2 +- tsconfig.json | 31 +++++++++++++++++++++++-------- utilities/ConsoleUtility.ts | 1 - 13 files changed, 44 insertions(+), 36 deletions(-) diff --git a/bun.lockb b/bun.lockb index 67c6b17f7f78ca6944955c3b3d34e584fc1116be..0b029f2c6d3345cbac53095b210f332a578f9e3d 100755 GIT binary patch delta 7543 zcma)B30zfGw?7-Xz(HowI$jmE!~wYs7rY?JaZWT6Qv}U45EPV2FQ}+_uP-N3U+5|; zGiS>*QzNIGK{T9k$_hT8zh|0L+V>pNFZKJcbM7(g{l53UgZr%WUwiGf*IsMwea>B8 z|G@p$8uxNb`;Be)_r51}FPs~4sMkb~O_^UM4Sv+>;BEGhII5hNtOb}vW^ zaU|{3o^i`Av1^a{rS@@o(UKGlDOr-74PEpBdV_%LT{v%ii6uX`K*}pD7|jE3p?RbK zw3{UPfc_0Q5Hz=eBsB!h$}SjJk}XNc!4Ci~2bCS%QJP&`Tq;R3!C=8r8TR7bQKiy8 zldjO7oj)Oayd-S|W`*NNWsQWWw8qu%;i((?$U~=#!1sq-QEovY%gy(aBwyf6P&Vvs zP&V`d#yOZ#07hfbS3sM9#(@TdwgP<))LxXATMUl`0J8xmP&RZHCgPR+48Z)6g@t2t zvn6Q?_}qU6%9)POE@nHV1Hdd#utovh;v@CeEX~1yMqupolceWC*#qGv<8!wFvx1B< z6Ep=^u`HH53(5u>a*HY6EktPpEg0ZT2jyw3plv_{Xq?+~jtmUsaIOYr?|4B0d*LB4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0Clw170njG+{|%=3VbKnM;O*E~3ie*!Ui%RY*bzZ^ zyOC>s2K)BX!KagP2I_bc>7 zgH7C~DGiFaNAntNeS@CRKTj4tdu;ljpAPyyQVblBfFvcyxApZ@Jl9^$xg0w5kDefj zt~7M`U$3)ps3!9AmnKp~qs?L*Kb8Kpv+H z3V$BFSr=W?Zb?m#wLVxuS`Ya8 zYnonYJ2>4^e+rm)hJx-Z+r4sd_Pb5MZGbD69N2hld&0>(!0mvyocZycZO`?>r*DkD zah&+>>Y@4hbi5-lKC8+n%$V?O(83*u9s|bjZ+Y3;ehuFq%GlJ{pwDD{Ful|i+uAwH sJ;+m9>~zQR(P8b5rhq3Z6NKngskRaRmB%AQ=&t|r6Y(K5ciF%GH@Ctsi~s-t diff --git a/controllers/AccountController.ts b/controllers/AccountController.ts index 955ed1c..cd6cee4 100644 --- a/controllers/AccountController.ts +++ b/controllers/AccountController.ts @@ -1,5 +1,5 @@ -import LoginViewModel from "../models/account/LoginViewModel"; -import RegisterViewModel from "../models/account/RegisterViewModel"; +import type LoginViewModel from "../models/account/LoginViewModel"; +import type RegisterViewModel from "../models/account/RegisterViewModel"; import Config from "../objects/Config"; import Session from "../objects/Session"; import UserService from "../services/UserService"; diff --git a/controllers/Controller.ts b/controllers/Controller.ts index 0f20a7c..bdb4492 100644 --- a/controllers/Controller.ts +++ b/controllers/Controller.ts @@ -1,10 +1,10 @@ -import { FastifyInstance, FastifyReply, FastifyRequest } from "fastify"; +import { cyan } from "dyetty"; import { Console } from "hsconsole"; +import type { FastifyInstance, FastifyReply, FastifyRequest } from "fastify"; +import RequestCtx from "../objects/RequestCtx"; import Session from "../objects/Session"; import SessionUser from "../objects/SessionUser"; -import RequestCtx from "../objects/RequestCtx"; import UserType from "../enums/UserType"; -import { cyan } from "dyetty"; // prepare for ts-ignore :3 // TODO: figure out some runtime field / type checking so @@ -47,7 +47,6 @@ export default abstract class Controller { // @ts-ignore const controllerRequestHandler = this[method]; const requestHandler = (req:FastifyRequest, res:FastifyReply) => { - const requestStartTime = Date.now(); let session = Session.CheckValiditiy(req.cookies); if (doAuth && session === undefined) { return res.redirect(`/account/login?returnTo=${encodeURIComponent(req.url)}`); @@ -148,10 +147,10 @@ export default abstract class Controller { public res: FastifyReply; // Methods - view(view?:string | Object, model?: Object) {} - redirectToAction(action:string, controller?:string) {} - ok(message?:string) {} - badRequest(message?:string) {} - unauthorised(message?:string) {} - forbidden(message?:string) {} + view(view?:string | Object, model?: Object) { view; model; } + redirectToAction(action:string, controller?:string) { action; controller; } + ok(message?:string) { message } + badRequest(message?:string) { message } + unauthorised(message?:string) { message } + forbidden(message?:string) { message } } \ No newline at end of file diff --git a/controllers/HomeController.ts b/controllers/HomeController.ts index 51f2ff6..adeef43 100644 --- a/controllers/HomeController.ts +++ b/controllers/HomeController.ts @@ -1,9 +1,6 @@ -import DashboardViewModel from "../models/home/DashboardViewModel"; -import Config from "../objects/Config"; -import HashFS from "../objects/HashFS"; -import UserService from "../services/UserService"; import Controller from "./Controller"; -import { randomBytes } from "crypto"; +import type DashboardViewModel from "../models/home/DashboardViewModel"; +import UserService from "../services/UserService"; export default class HomeController extends Controller { public async Index_Get_AllowAnonymous() { diff --git a/index.ts b/index.ts index 6e897f8..ee5ae0c 100644 --- a/index.ts +++ b/index.ts @@ -15,9 +15,7 @@ import AccountController from "./controllers/AccountController"; import { magenta, blue, cyan, green, red } from "dyetty"; import ConsoleUtility from "./utilities/ConsoleUtility"; import HashFS from "./objects/HashFS"; -import { existsSync, mkdirSync, rmSync } from "fs"; import FunkyArray from "funky-array"; -import UserService from "./services/UserService"; import MediaService from "./services/MediaService"; import Media from "./entities/Media"; @@ -98,7 +96,7 @@ fastify.addHook("onSend", (req, res, _payload, done) => { done(); }); -fastify.setNotFoundHandler(async (req, res) => { +fastify.setNotFoundHandler(async (_req, res) => { return res.status(404).view("views/404.ejs"); }); diff --git a/objects/Database.ts b/objects/Database.ts index aece586..4050872 100644 --- a/objects/Database.ts +++ b/objects/Database.ts @@ -1,6 +1,6 @@ import { blue } from "dyetty"; import { Console } from "hsconsole"; -import { createPool, Pool, RowDataPacket } from "mysql2"; +import { createPool, type Pool, type RowDataPacket } from "mysql2"; export type DBInDataType = string | number | Date | null | undefined; diff --git a/objects/HashFS.ts b/objects/HashFS.ts index 0b88053..ac5c67f 100644 --- a/objects/HashFS.ts +++ b/objects/HashFS.ts @@ -1,13 +1,13 @@ // ! Hashed File Store (not file system!!) import { join } from "path"; -import { existsSync, mkdirSync, createWriteStream, rename, stat, writeFile, copyFile, rm, rmSync, } from "fs"; +import { existsSync, mkdirSync, createWriteStream, rename, stat, writeFile, rm, rmSync, } from "fs"; import { Console } from "hsconsole"; import { yellow } from "dyetty"; import { createHash, randomBytes } from "crypto"; import FunkyArray from "funky-array"; import HashFSFileInformation from "./HashFSFileInformation"; -import { BusboyFileStream } from "@fastify/busboy" +import type { BusboyFileStream } from "@fastify/busboy"; export default class HashFS { public static STARTUP_DIR: string; diff --git a/objects/RequestCtx.ts b/objects/RequestCtx.ts index a4aa7b8..11fd2b5 100644 --- a/objects/RequestCtx.ts +++ b/objects/RequestCtx.ts @@ -1,4 +1,4 @@ -import { FastifyReply, FastifyRequest } from "fastify"; +import { type FastifyReply, type FastifyRequest } from "fastify"; import SessionUser from "./SessionUser"; import UserType from "../enums/UserType"; diff --git a/objects/Session.ts b/objects/Session.ts index 3fc97b6..39e9040 100644 --- a/objects/Session.ts +++ b/objects/Session.ts @@ -2,7 +2,7 @@ import Config from "./Config"; import FastifyCookie from "@fastify/cookie"; import FunkyArray from "funky-array"; import SessionUser from "./SessionUser"; -import { FastifyReply, FastifyRequest } from "fastify"; +import { type FastifyReply } from "fastify"; import User from "../entities/User"; import { randomBytes } from "crypto"; diff --git a/package.json b/package.json index 06b1188..e9be00e 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,8 @@ "build": "tsc --build" }, "devDependencies": { + "@types/bun": "^1.1.15", "@types/ejs": "^3.1.5", - "@types/node": "^22.10.4", "@vercel/ncc": "^0.38.3", "check-outdated": "^2.12.0", "nodemon": "^3.1.9", diff --git a/services/UserService.ts b/services/UserService.ts index ad182b7..adeed28 100644 --- a/services/UserService.ts +++ b/services/UserService.ts @@ -4,7 +4,7 @@ import PasswordUtility from "../utilities/PasswordUtility"; import UserType from "../enums/UserType"; import User from "../entities/User"; import MediaRepo from "../repos/MediaRepo"; -import { MultipartFile } from "@fastify/multipart" +import { type MultipartFile } from "@fastify/multipart" import HashFS from "../objects/HashFS"; import Media from "../entities/Media"; import { randomBytes } from "crypto"; diff --git a/tsconfig.json b/tsconfig.json index 747094e..df029f1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,27 @@ { "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", - "target": "ES2022", - "esModuleInterop": true, - "resolveJsonModule": true, - "rootDir": "./", - "outDir": "./build", - "strict": true + // Enable latest features + "lib": ["ESNext"], + "target": "ESNext", + "module": "ESNext", + "moduleDetection": "force", + "jsx": "react-jsx", + "allowJs": true, + + // Bundler mode + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "noEmit": true, + + // Best practices + "strict": true, + "skipLibCheck": true, + "noFallthroughCasesInSwitch": true, + + // Some stricter flags + "noUnusedLocals": true, + "noUnusedParameters": true, + "noPropertyAccessFromIndexSignature": true } } \ No newline at end of file diff --git a/utilities/ConsoleUtility.ts b/utilities/ConsoleUtility.ts index ca8349f..926399e 100644 --- a/utilities/ConsoleUtility.ts +++ b/utilities/ConsoleUtility.ts @@ -1,5 +1,4 @@ import { green, yellow, red, gray } from "dyetty"; -import { Console } from "hsconsole"; export default abstract class ConsoleUtility { public static StatusColor(statusCode: number) {