From ea7ebe66b1017688ebe8d2aea8af277ff5a9f69c Mon Sep 17 00:00:00 2001 From: Palanikannan M Date: Tue, 25 Mar 2025 17:51:53 +0530 Subject: [PATCH 1/3] feat: express decorators for rest apis and websocket --- packages/decorators/.eslintignore | 4 + packages/decorators/.eslintrc.js | 10 + packages/decorators/README.md | 99 ++++++++ packages/decorators/package.json | 42 +++ packages/decorators/src/controller.ts | 61 +++++ packages/decorators/src/index.ts | 15 ++ packages/decorators/src/rest.ts | 111 ++++++++ .../decorators/src/websocket-controller.ts | 85 +++++++ packages/decorators/src/websocket.ts | 17 ++ packages/decorators/tsconfig.json | 18 ++ packages/decorators/tsup.config.ts | 12 + yarn.lock | 239 +++++++++++++++++- 12 files changed, 708 insertions(+), 5 deletions(-) create mode 100644 packages/decorators/.eslintignore create mode 100644 packages/decorators/.eslintrc.js create mode 100644 packages/decorators/README.md create mode 100644 packages/decorators/package.json create mode 100644 packages/decorators/src/controller.ts create mode 100644 packages/decorators/src/index.ts create mode 100644 packages/decorators/src/rest.ts create mode 100644 packages/decorators/src/websocket-controller.ts create mode 100644 packages/decorators/src/websocket.ts create mode 100644 packages/decorators/tsconfig.json create mode 100644 packages/decorators/tsup.config.ts diff --git a/packages/decorators/.eslintignore b/packages/decorators/.eslintignore new file mode 100644 index 00000000000..31ca214177a --- /dev/null +++ b/packages/decorators/.eslintignore @@ -0,0 +1,4 @@ +node_modules +build/* +dist/* +out/* diff --git a/packages/decorators/.eslintrc.js b/packages/decorators/.eslintrc.js new file mode 100644 index 00000000000..c1728ac282e --- /dev/null +++ b/packages/decorators/.eslintrc.js @@ -0,0 +1,10 @@ +/** @type {import("eslint").Linter.Config} */ +module.exports = { + root: true, + extends: ["@plane/eslint-config/library.js"], + parser: "@typescript-eslint/parser", + parserOptions: { + project: true, + }, +}; + diff --git a/packages/decorators/README.md b/packages/decorators/README.md new file mode 100644 index 00000000000..e9c308e9e6a --- /dev/null +++ b/packages/decorators/README.md @@ -0,0 +1,99 @@ +# @plane/decorators + +A lightweight TypeScript decorator library for building Express.js controllers with a clean, declarative syntax. + +## Features + +- TypeScript-first design +- Decorators for HTTP methods (GET, POST, PUT, PATCH, DELETE) +- WebSocket support +- Middleware support +- No build step required - works directly with TypeScript files + +## Installation + +This package is part of the Plane workspace and can be used by adding it to your project's dependencies: + +```json +{ + "dependencies": { + "@plane/decorators": "*" + } +} +``` + +## Usage + +### Basic REST Controller + +```typescript +import { Controller, Get, Post, BaseController } from "@plane/decorators"; +import { Router, Request, Response } from "express"; + +@Controller("/api/users") +class UserController extends BaseController { + @Get("/") + async getUsers(req: Request, res: Response) { + return res.json({ users: [] }); + } + + @Post("/") + async createUser(req: Request, res: Response) { + return res.json({ success: true }); + } +} + +// Register routes +const router = Router(); +const userController = new UserController(); +userController.registerRoutes(router); +``` + +### WebSocket Controller + +```typescript +import { + Controller, + WebSocket, + BaseWebSocketController, +} from "@plane/decorators"; +import { Request } from "express"; +import { WebSocket as WS } from "ws"; + +@Controller("/ws/chat") +class ChatController extends BaseWebSocketController { + @WebSocket("/") + handleConnection(ws: WS, req: Request) { + ws.on("message", (message) => { + ws.send(`Received: ${message}`); + }); + } +} + +// Register WebSocket routes +const router = require("express-ws")(app).router; +const chatController = new ChatController(); +chatController.registerWebSocketRoutes(router); +``` + +## API Reference + +### Decorators + +- `@Controller(baseRoute: string)` - Class decorator for defining a base route +- `@Get(route: string)` - Method decorator for HTTP GET endpoints +- `@Post(route: string)` - Method decorator for HTTP POST endpoints +- `@Put(route: string)` - Method decorator for HTTP PUT endpoints +- `@Patch(route: string)` - Method decorator for HTTP PATCH endpoints +- `@Delete(route: string)` - Method decorator for HTTP DELETE endpoints +- `@WebSocket(route: string)` - Method decorator for WebSocket endpoints +- `@Middleware(middleware: RequestHandler)` - Method decorator for applying middleware + +### Classes + +- `BaseController` - Base class for REST controllers +- `BaseWebSocketController` - Base class for WebSocket controllers + +## License + +This project is licensed under the [GNU Affero General Public License v3.0](https://github.com/makeplane/plane/blob/master/LICENSE.txt). diff --git a/packages/decorators/package.json b/packages/decorators/package.json new file mode 100644 index 00000000000..9d2563b7c2e --- /dev/null +++ b/packages/decorators/package.json @@ -0,0 +1,42 @@ +{ + "name": "@plane/decorators", + "version": "0.1.0", + "description": "Controller and route decorators for Express.js applications", + "license": "AGPL-3.0", + "private": true, + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist/**" + ], + "scripts": { + "build": "tsup src/index.ts --format esm,cjs --dts --external express,ws", + "dev": "tsup src/index.ts --format esm,cjs --watch --dts --external express,ws", + "lint": "eslint src --ext .ts,.tsx", + "lint:errors": "eslint src --ext .ts,.tsx --quiet" + }, + "dependencies": { + "reflect-metadata": "^0.2.2" + }, + "devDependencies": { + "@plane/eslint-config": "*", + "@types/express": "^4.17.21", + "@types/reflect-metadata": "^0.1.0", + "@plane/typescript-config": "*", + "@types/node": "^20.14.9", + "@types/ws": "^8.5.10", + "express": "^4.21.2", + "tsup": "8.3.0", + "typescript": "^5.3.3" + }, + "peerDependencies": { + "express": ">=4.21.2", + "ws": ">=8.0.0" + }, + "peerDependenciesMeta": { + "ws": { + "optional": true + } + } +} diff --git a/packages/decorators/src/controller.ts b/packages/decorators/src/controller.ts new file mode 100644 index 00000000000..a9185a8480c --- /dev/null +++ b/packages/decorators/src/controller.ts @@ -0,0 +1,61 @@ +import { RequestHandler, Router } from "express"; +import "reflect-metadata"; + +type HttpMethod = + | "get" + | "post" + | "put" + | "delete" + | "patch" + | "options" + | "head" + | "ws"; + +interface ControllerInstance { + [key: string]: unknown; +} + +interface ControllerConstructor { + new (...args: any[]): ControllerInstance; + prototype: ControllerInstance; +} + +export function registerControllers( + router: Router, + Controller: ControllerConstructor, +): void { + const instance = new Controller(); + const baseRoute = Reflect.getMetadata("baseRoute", Controller) as string; + + Object.getOwnPropertyNames(Controller.prototype).forEach((methodName) => { + if (methodName === "constructor") return; // Skip the constructor + + const method = Reflect.getMetadata( + "method", + instance, + methodName, + ) as HttpMethod; + const route = Reflect.getMetadata("route", instance, methodName) as string; + const middlewares = + (Reflect.getMetadata( + "middlewares", + instance, + methodName, + ) as RequestHandler[]) || []; + + if (method && route) { + const handler = instance[methodName] as unknown; + + if (typeof handler === "function") { + if (method !== "ws") { + ( + router[method] as ( + path: string, + ...handlers: RequestHandler[] + ) => void + )(`${baseRoute}${route}`, ...middlewares, handler.bind(instance)); + } + } + } + }); +} diff --git a/packages/decorators/src/index.ts b/packages/decorators/src/index.ts new file mode 100644 index 00000000000..ef71360595b --- /dev/null +++ b/packages/decorators/src/index.ts @@ -0,0 +1,15 @@ +// Export individual decorators +export { Controller, Middleware } from "./rest"; +export { Get, Post, Put, Patch, Delete } from "./rest"; +export { WebSocket } from "./websocket"; +export { registerControllers } from "./controller"; +export { registerWebSocketControllers } from "./websocket-controller"; + +// Also provide namespaced exports for better organization +import * as RestDecorators from "./rest"; +import * as WebSocketDecorators from "./websocket"; + +// Named namespace exports +export const Rest = RestDecorators; +export const WebSocketNS = WebSocketDecorators; + diff --git a/packages/decorators/src/rest.ts b/packages/decorators/src/rest.ts new file mode 100644 index 00000000000..b34b3a83455 --- /dev/null +++ b/packages/decorators/src/rest.ts @@ -0,0 +1,111 @@ +import "reflect-metadata"; +import { RequestHandler } from "express"; + +/** + * Controller decorator + * @param baseRoute + * @returns + */ +export function Controller(baseRoute: string = ""): ClassDecorator { + return function (target: Function) { + Reflect.defineMetadata("baseRoute", baseRoute, target); + }; +} + +/** + * Controller GET method decorator + * @param route + * @returns + */ +export function Get(route: string): MethodDecorator { + return function ( + target: object, + propertyKey: string | symbol, + descriptor: PropertyDescriptor, + ) { + Reflect.defineMetadata("method", "get", target, propertyKey); + Reflect.defineMetadata("route", route, target, propertyKey); + }; +} + +/** + * Controller POST method decorator + * @param route + * @returns + */ +export function Post(route: string): MethodDecorator { + return function ( + target: object, + propertyKey: string | symbol, + descriptor: PropertyDescriptor, + ) { + Reflect.defineMetadata("method", "post", target, propertyKey); + Reflect.defineMetadata("route", route, target, propertyKey); + }; +} + +/** + * Controller PATCH method decorator + * @param route + * @returns + */ +export function Patch(route: string): MethodDecorator { + return function ( + target: object, + propertyKey: string | symbol, + descriptor: PropertyDescriptor, + ) { + Reflect.defineMetadata("method", "patch", target, propertyKey); + Reflect.defineMetadata("route", route, target, propertyKey); + }; +} + +/** + * Controller PUT method decorator + * @param route + * @returns + */ +export function Put(route: string): MethodDecorator { + return function ( + target: object, + propertyKey: string | symbol, + descriptor: PropertyDescriptor, + ) { + Reflect.defineMetadata("method", "put", target, propertyKey); + Reflect.defineMetadata("route", route, target, propertyKey); + }; +} + +/** + * Controller DELETE method decorator + * @param route + * @returns + */ +export function Delete(route: string): MethodDecorator { + return function ( + target: object, + propertyKey: string | symbol, + descriptor: PropertyDescriptor, + ) { + Reflect.defineMetadata("method", "delete", target, propertyKey); + Reflect.defineMetadata("route", route, target, propertyKey); + }; +} + +/** + * Middleware decorator + * @param middleware + * @returns + */ +export function Middleware(middleware: RequestHandler): MethodDecorator { + return function ( + target: object, + propertyKey: string | symbol, + descriptor: PropertyDescriptor, + ) { + const middlewares = + Reflect.getMetadata("middlewares", target, propertyKey) || []; + middlewares.push(middleware); + Reflect.defineMetadata("middlewares", middlewares, target, propertyKey); + }; +} diff --git a/packages/decorators/src/websocket-controller.ts b/packages/decorators/src/websocket-controller.ts new file mode 100644 index 00000000000..3b5c04ad07a --- /dev/null +++ b/packages/decorators/src/websocket-controller.ts @@ -0,0 +1,85 @@ +import type { Router, Request } from "express"; +import type { WebSocket } from "ws"; +import "reflect-metadata"; + +interface ControllerInstance { + [key: string]: unknown; +} + +interface ControllerConstructor { + new (...args: any[]): ControllerInstance; + prototype: ControllerInstance; +} + +export function registerWebSocketControllers( + router: Router, + Controller: ControllerConstructor, + existingInstance?: ControllerInstance, +): void { + const instance = existingInstance || new Controller(); + const baseRoute = Reflect.getMetadata("baseRoute", Controller) as string; + + Object.getOwnPropertyNames(Controller.prototype).forEach((methodName) => { + if (methodName === "constructor") return; // Skip the constructor + + const method = Reflect.getMetadata( + "method", + instance, + methodName, + ) as string; + const route = Reflect.getMetadata("route", instance, methodName) as string; + + if (method === "ws" && route) { + const handler = instance[methodName] as unknown; + + if ( + typeof handler === "function" && + typeof (router as any).ws === "function" + ) { + (router as any).ws( + `${baseRoute}${route}`, + (ws: WebSocket, req: Request) => { + try { + handler.call(instance, ws, req); + } catch (error) { + console.error( + `WebSocket error in ${Controller.name}.${methodName}`, + error, + ); + ws.close( + 1011, + error instanceof Error + ? error.message + : "Internal server error", + ); + } + }, + ); + } + } + }); +} + +/** + * Base controller class for WebSocket endpoints + */ +export abstract class BaseWebSocketController { + protected router: Router; + + constructor() { + this.router = Router(); + } + + /** + * Get the base route for this controller + */ + protected getBaseRoute(): string { + return Reflect.getMetadata("baseRoute", this.constructor) || ""; + } + + /** + * Abstract method to handle WebSocket connections + * Implement this in your derived class + */ + abstract handleConnection(ws: WebSocket, req: Request): void; +} diff --git a/packages/decorators/src/websocket.ts b/packages/decorators/src/websocket.ts new file mode 100644 index 00000000000..5b6b6a7b18d --- /dev/null +++ b/packages/decorators/src/websocket.ts @@ -0,0 +1,17 @@ +import "reflect-metadata"; + +/** + * WebSocket method decorator + * @param route + * @returns + */ +export function WebSocket(route: string): MethodDecorator { + return function ( + target: object, + propertyKey: string | symbol, + descriptor: PropertyDescriptor, + ) { + Reflect.defineMetadata("method", "ws", target, propertyKey); + Reflect.defineMetadata("route", route, target, propertyKey); + }; +} diff --git a/packages/decorators/tsconfig.json b/packages/decorators/tsconfig.json new file mode 100644 index 00000000000..16a7a8c802e --- /dev/null +++ b/packages/decorators/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "@plane/typescript-config/react-library.json", + "compilerOptions": { + "jsx": "react", + "lib": [ + "esnext", + "dom" + ], + }, + "include": [ + "./src" + ], + "exclude": [ + "dist", + "build", + "node_modules" + ] +} diff --git a/packages/decorators/tsup.config.ts b/packages/decorators/tsup.config.ts new file mode 100644 index 00000000000..757dd8ba38c --- /dev/null +++ b/packages/decorators/tsup.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from 'tsup'; + +export default defineConfig({ + entry: ['src/index.ts'], + format: ['esm', 'cjs'], + dts: true, + splitting: false, + sourcemap: true, + clean: true, + external: ['express', 'ws'], + treeshake: true, +}); \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 783bb901ea1..44b8c7ba9a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2605,96 +2605,196 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.35.0.tgz#e1d7700735f7e8de561ef7d1fa0362082a180c43" integrity sha512-uYQ2WfPaqz5QtVgMxfN6NpLD+no0MYHDBywl7itPYd3K5TjjSghNKmX8ic9S8NU8w81NVhJv/XojcHptRly7qQ== +"@rollup/rollup-android-arm-eabi@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.37.0.tgz#9bedc746a97fe707154086365f269ced92ff4aa9" + integrity sha512-l7StVw6WAa8l3vA1ov80jyetOAEo1FtHvZDbzXDO/02Sq/QVvqlHkYoFwDJPIMj0GKiistsBudfx5tGFnwYWDQ== + "@rollup/rollup-android-arm64@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.35.0.tgz#fa6cdfb1fc9e2c8e227a7f35d524d8f7f90cf4db" integrity sha512-FtKddj9XZudurLhdJnBl9fl6BwCJ3ky8riCXjEw3/UIbjmIY58ppWwPEvU3fNu+W7FUsAsB1CdH+7EQE6CXAPA== +"@rollup/rollup-android-arm64@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.37.0.tgz#6edc6ffc8af8773e4bc28c72894dd5e846b8ee6c" + integrity sha512-6U3SlVyMxezt8Y+/iEBcbp945uZjJwjZimu76xoG7tO1av9VO691z8PkhzQ85ith2I8R2RddEPeSfcbyPfD4hA== + "@rollup/rollup-darwin-arm64@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.35.0.tgz#6da5a1ddc4f11d4a7ae85ab443824cb6bf614e30" integrity sha512-Uk+GjOJR6CY844/q6r5DR/6lkPFOw0hjfOIzVx22THJXMxktXG6CbejseJFznU8vHcEBLpiXKY3/6xc+cBm65Q== +"@rollup/rollup-darwin-arm64@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.37.0.tgz#737a7b8be9ff79bd24a7efaae0903e8c66ac0676" + integrity sha512-+iTQ5YHuGmPt10NTzEyMPbayiNTcOZDWsbxZYR1ZnmLnZxG17ivrPSWFO9j6GalY0+gV3Jtwrrs12DBscxnlYA== + "@rollup/rollup-darwin-x64@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.35.0.tgz#25b74ce2d8d3f9ea8e119b01384d44a1c0a0d3ae" integrity sha512-3IrHjfAS6Vkp+5bISNQnPogRAW5GAV1n+bNCrDwXmfMHbPl5EhTmWtfmwlJxFRUCBZ+tZ/OxDyU08aF6NI/N5Q== +"@rollup/rollup-darwin-x64@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.37.0.tgz#a6a697bb685ca9462a7caeea5f22f6a686acff1f" + integrity sha512-m8W2UbxLDcmRKVjgl5J/k4B8d7qX2EcJve3Sut7YGrQoPtCIQGPH5AMzuFvYRWZi0FVS0zEY4c8uttPfX6bwYQ== + "@rollup/rollup-freebsd-arm64@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.35.0.tgz#be3d39e3441df5d6e187c83d158c60656c82e203" integrity sha512-sxjoD/6F9cDLSELuLNnY0fOrM9WA0KrM0vWm57XhrIMf5FGiN8D0l7fn+bpUeBSU7dCgPV2oX4zHAsAXyHFGcQ== +"@rollup/rollup-freebsd-arm64@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.37.0.tgz#18113e8e133ccb6de4b9dc9d3e09f7acff344cb7" + integrity sha512-FOMXGmH15OmtQWEt174v9P1JqqhlgYge/bUjIbiVD1nI1NeJ30HYT9SJlZMqdo1uQFyt9cz748F1BHghWaDnVA== + "@rollup/rollup-freebsd-x64@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.35.0.tgz#cd932d3ec679711efd65ca25821fb318e25b7ce4" integrity sha512-2mpHCeRuD1u/2kruUiHSsnjWtHjqVbzhBkNVQ1aVD63CcexKVcQGwJ2g5VphOd84GvxfSvnnlEyBtQCE5hxVVw== +"@rollup/rollup-freebsd-x64@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.37.0.tgz#5e56ffd4a0d7ccfcbc86867c40b8f0e6a2c0c81e" + integrity sha512-SZMxNttjPKvV14Hjck5t70xS3l63sbVwl98g3FlVVx2YIDmfUIy29jQrsw06ewEYQ8lQSuY9mpAPlmgRD2iSsA== + "@rollup/rollup-linux-arm-gnueabihf@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.35.0.tgz#d300b74c6f805474225632f185daaeae760ac2bb" integrity sha512-mrA0v3QMy6ZSvEuLs0dMxcO2LnaCONs1Z73GUDBHWbY8tFFocM6yl7YyMu7rz4zS81NDSqhrUuolyZXGi8TEqg== +"@rollup/rollup-linux-arm-gnueabihf@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.37.0.tgz#5addf1a51e1495ae7ff28d26442a88adf629c980" + integrity sha512-hhAALKJPidCwZcj+g+iN+38SIOkhK2a9bqtJR+EtyxrKKSt1ynCBeqrQy31z0oWU6thRZzdx53hVgEbRkuI19w== + "@rollup/rollup-linux-arm-musleabihf@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.35.0.tgz#2caac622380f314c41934ed1e68ceaf6cc380cc3" integrity sha512-DnYhhzcvTAKNexIql8pFajr0PiDGrIsBYPRvCKlA5ixSS3uwo/CWNZxB09jhIapEIg945KOzcYEAGGSmTSpk7A== +"@rollup/rollup-linux-arm-musleabihf@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.37.0.tgz#00cddb9ab51086c5f2cd33cd4738259e24be4e73" + integrity sha512-jUb/kmn/Gd8epbHKEqkRAxq5c2EwRt0DqhSGWjPFxLeFvldFdHQs/n8lQ9x85oAeVb6bHcS8irhTJX2FCOd8Ag== + "@rollup/rollup-linux-arm64-gnu@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.35.0.tgz#1ec841650b038cc15c194c26326483fd7ebff3e3" integrity sha512-uagpnH2M2g2b5iLsCTZ35CL1FgyuzzJQ8L9VtlJ+FckBXroTwNOaD0z0/UF+k5K3aNQjbm8LIVpxykUOQt1m/A== +"@rollup/rollup-linux-arm64-gnu@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.37.0.tgz#c3b4324496236b6fd9f31fda5701c6d6060b1512" + integrity sha512-oNrJxcQT9IcbcmKlkF+Yz2tmOxZgG9D9GRq+1OE6XCQwCVwxixYAa38Z8qqPzQvzt1FCfmrHX03E0pWoXm1DqA== + "@rollup/rollup-linux-arm64-musl@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.35.0.tgz#2fc70a446d986e27f6101ea74e81746987f69150" integrity sha512-XQxVOCd6VJeHQA/7YcqyV0/88N6ysSVzRjJ9I9UA/xXpEsjvAgDTgH3wQYz5bmr7SPtVK2TsP2fQ2N9L4ukoUg== +"@rollup/rollup-linux-arm64-musl@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.37.0.tgz#b5222180bb1a50e6e9bc8263efd771c1ce770b6f" + integrity sha512-pfxLBMls+28Ey2enpX3JvjEjaJMBX5XlPCZNGxj4kdJyHduPBXtxYeb8alo0a7bqOoWZW2uKynhHxF/MWoHaGQ== + "@rollup/rollup-linux-loongarch64-gnu@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.35.0.tgz#561bd045cd9ce9e08c95f42e7a8688af8c93d764" integrity sha512-5pMT5PzfgwcXEwOaSrqVsz/LvjDZt+vQ8RT/70yhPU06PTuq8WaHhfT1LW+cdD7mW6i/J5/XIkX/1tCAkh1W6g== +"@rollup/rollup-linux-loongarch64-gnu@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.37.0.tgz#5660181c1c1efb7b19c7a531d496e685236c5ce7" + integrity sha512-yCE0NnutTC/7IGUq/PUHmoeZbIwq3KRh02e9SfFh7Vmc1Z7atuJRYWhRME5fKgT8aS20mwi1RyChA23qSyRGpA== + "@rollup/rollup-linux-powerpc64le-gnu@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.35.0.tgz#45d849a0b33813f33fe5eba9f99e0ff15ab5caad" integrity sha512-c+zkcvbhbXF98f4CtEIP1EBA/lCic5xB0lToneZYvMeKu5Kamq3O8gqrxiYYLzlZH6E3Aq+TSW86E4ay8iD8EA== +"@rollup/rollup-linux-powerpc64le-gnu@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.37.0.tgz#8273166495d2f5d3fbc556cf42a5a6e24b78bdab" + integrity sha512-NxcICptHk06E2Lh3a4Pu+2PEdZ6ahNHuK7o6Np9zcWkrBMuv21j10SQDJW3C9Yf/A/P7cutWoC/DptNLVsZ0VQ== + "@rollup/rollup-linux-riscv64-gnu@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.35.0.tgz#78dde3e6fcf5b5733a97d0a67482d768aa1e83a5" integrity sha512-s91fuAHdOwH/Tad2tzTtPX7UZyytHIRR6V4+2IGlV0Cej5rkG0R61SX4l4y9sh0JBibMiploZx3oHKPnQBKe4g== +"@rollup/rollup-linux-riscv64-gnu@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.37.0.tgz#9677e39288ccc91ebcd707cdd794732d701cd174" + integrity sha512-PpWwHMPCVpFZLTfLq7EWJWvrmEuLdGn1GMYcm5MV7PaRgwCEYJAwiN94uBuZev0/J/hFIIJCsYw4nLmXA9J7Pw== + +"@rollup/rollup-linux-riscv64-musl@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.37.0.tgz#71cc5ca7be1ed263357618bfe4f8f50c09725a7e" + integrity sha512-DTNwl6a3CfhGTAOYZ4KtYbdS8b+275LSLqJVJIrPa5/JuIufWWZ/QFvkxp52gpmguN95eujrM68ZG+zVxa8zHA== + "@rollup/rollup-linux-s390x-gnu@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.35.0.tgz#2e34835020f9e03dfb411473a5c2a0e8a9c5037b" integrity sha512-hQRkPQPLYJZYGP+Hj4fR9dDBMIM7zrzJDWFEMPdTnTy95Ljnv0/4w/ixFw3pTBMEuuEuoqtBINYND4M7ujcuQw== +"@rollup/rollup-linux-s390x-gnu@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.37.0.tgz#6b0b7df33eb32b0ee7423898b183acc1b5fee33e" + integrity sha512-hZDDU5fgWvDdHFuExN1gBOhCuzo/8TMpidfOR+1cPZJflcEzXdCy1LjnklQdW8/Et9sryOPJAKAQRw8Jq7Tg+A== + "@rollup/rollup-linux-x64-gnu@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.35.0.tgz#4f9774beddc6f4274df57ac99862eb23040de461" integrity sha512-Pim1T8rXOri+0HmV4CdKSGrqcBWX0d1HoPnQ0uw0bdp1aP5SdQVNBy8LjYncvnLgu3fnnCt17xjWGd4cqh8/hA== +"@rollup/rollup-linux-x64-gnu@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.37.0.tgz#52c27717d3c4819d13b5ebc2373ddea099d2e71b" + integrity sha512-pKivGpgJM5g8dwj0ywBwe/HeVAUSuVVJhUTa/URXjxvoyTT/AxsLTAbkHkDHG7qQxLoW2s3apEIl26uUe08LVQ== + "@rollup/rollup-linux-x64-musl@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.35.0.tgz#dfcff2c1aed518b3d23ccffb49afb349d74fb608" integrity sha512-QysqXzYiDvQWfUiTm8XmJNO2zm9yC9P/2Gkrwg2dH9cxotQzunBHYr6jk4SujCTqnfGxduOmQcI7c2ryuW8XVg== +"@rollup/rollup-linux-x64-musl@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.37.0.tgz#c134a22d30642345de8b799c816345674bf68019" + integrity sha512-E2lPrLKE8sQbY/2bEkVTGDEk4/49UYRVWgj90MY8yPjpnGBQ+Xi1Qnr7b7UIWw1NOggdFQFOLZ8+5CzCiz143w== + "@rollup/rollup-win32-arm64-msvc@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.35.0.tgz#b0b37e2d77041e3aa772f519291309abf4c03a84" integrity sha512-OUOlGqPkVJCdJETKOCEf1mw848ZyJ5w50/rZ/3IBQVdLfR5jk/6Sr5m3iO2tdPgwo0x7VcncYuOvMhBWZq8ayg== +"@rollup/rollup-win32-arm64-msvc@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.37.0.tgz#8063d5f8195dd1845e056d069366fbe06a424d09" + integrity sha512-Jm7biMazjNzTU4PrQtr7VS8ibeys9Pn29/1bm4ph7CP2kf21950LgN+BaE2mJ1QujnvOc6p54eWWiVvn05SOBg== + "@rollup/rollup-win32-ia32-msvc@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.35.0.tgz#5b5a40e44a743ddc0e06b8e1b3982f856dc9ce0a" integrity sha512-2/lsgejMrtwQe44glq7AFFHLfJBPafpsTa6JvP2NGef/ifOa4KBoglVf7AKN7EV9o32evBPRqfg96fEHzWo5kw== +"@rollup/rollup-win32-ia32-msvc@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.37.0.tgz#891d90e3b5517f9d290bb416afdfe2ebfb12139e" + integrity sha512-e3/1SFm1OjefWICB2Ucstg2dxYDkDTZGDYgwufcbsxTHyqQps1UQf33dFEChBNmeSsTOyrjw2JJq0zbG5GF6RA== + "@rollup/rollup-win32-x64-msvc@4.35.0": version "4.35.0" resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.35.0.tgz#05f25dbc9981bee1ae6e713daab10397044a46ca" integrity sha512-PIQeY5XDkrOysbQblSW7v3l1MDZzkTEzAfTPkj5VAu3FW8fS4ynyLg2sINp0fp3SjZ8xkRYpLqoKcYqAkhU1dw== +"@rollup/rollup-win32-x64-msvc@4.37.0": + version "4.37.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.37.0.tgz#a54d7304c3bd45573d8bcd1270de89771f8195fe" + integrity sha512-LWbXUBwn/bcLx2sSsqy7pK5o+Nr+VCoRoAohfJ5C/aBio9nfJmGQqHAhU6pwxV/RmyTk5AqdySma7uwWGlmeuA== + "@rtsao/scc@^1.1.0": version "1.1.0" resolved "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8" @@ -4244,6 +4344,13 @@ resolved "https://registry.npmjs.org/@types/reactcss/-/reactcss-1.2.13.tgz#11c7468cc96b5353f7af998a5664deae21c7af08" integrity sha512-gi3S+aUi6kpkF5vdhUsnkwbiSEIU/BEJyD7kBy2SudWBUuKmJk8AQKE0OVcQQeEy40Azh0lV6uynxlikYIJuwg== +"@types/reflect-metadata@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@types/reflect-metadata/-/reflect-metadata-0.1.0.tgz#592805bdf6d63dd7229773218afeba37ac2eab16" + integrity sha512-bXltFLY3qhzCnVYP5iUpeSICagQ8rc9K2liS+8M0lBcz54BHs3O6W5UvqespVSuebo1BXLi+/y9ioELAW9SC2A== + dependencies: + reflect-metadata "*" + "@types/resolve@^1.20.2": version "1.20.6" resolved "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.6.tgz#e6e60dad29c2c8c206c026e6dd8d6d1bdda850b8" @@ -4325,6 +4432,13 @@ dependencies: "@types/node" "*" +"@types/ws@^8.5.10": + version "8.18.0" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.18.0.tgz#8a2ec491d6f0685ceaab9a9b7ff44146236993b5" + integrity sha512-8svvI3hMyvN0kKCJMvTJP/x6Y/EoQbepff882wL+Sn5QsXb3etnamgrJq4isrBxSJj5L2AuXcI0+bgkoAXGUJw== + dependencies: + "@types/node" "*" + "@types/zxcvbn@^4.4.4", "@types/zxcvbn@^4.4.5": version "4.4.5" resolved "https://registry.npmjs.org/@types/zxcvbn/-/zxcvbn-4.4.5.tgz#8ce8623ed7a36e3a76d1c0b539708dfb2e859bc0" @@ -5280,7 +5394,7 @@ buffer@^6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" -bundle-require@^5.1.0: +bundle-require@^5.0.0, bundle-require@^5.1.0: version "5.1.0" resolved "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz#8db66f41950da3d77af1ef3322f4c3e04009faee" integrity sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA== @@ -5668,6 +5782,11 @@ concurrently@^9.0.1: tree-kill "^1.2.2" yargs "^17.7.2" +consola@^3.2.3: + version "3.4.2" + resolved "https://registry.yarnpkg.com/consola/-/consola-3.4.2.tgz#5af110145397bb67afdab77013fdc34cae590ea7" + integrity sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA== + consola@^3.4.0: version "3.4.0" resolved "https://registry.npmjs.org/consola/-/consola-3.4.0.tgz#4cfc9348fd85ed16a17940b3032765e31061ab88" @@ -5775,7 +5894,7 @@ cross-fetch@^3.1.5: dependencies: node-fetch "^2.7.0" -cross-spawn@^7.0.0, cross-spawn@^7.0.2: +cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.6" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== @@ -6606,7 +6725,7 @@ esbuild-register@^3.5.0: dependencies: debug "^4.3.4" -esbuild@0.25.0, "esbuild@^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 || ^0.24.0", esbuild@^0.25.0: +esbuild@0.25.0, "esbuild@^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 || ^0.24.0", esbuild@^0.23.0, esbuild@^0.25.0: version "0.25.0" resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.25.0.tgz#0de1787a77206c5a79eeb634a623d39b5006ce92" integrity sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw== @@ -6942,6 +7061,21 @@ events@^3.2.0, events@^3.3.0: resolved "https://registry.npmjs.org/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== +execa@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + expand-template@^2.0.3: version "2.0.3" resolved "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" @@ -7413,6 +7547,11 @@ get-stdin@^9.0.0: resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-9.0.0.tgz#3983ff82e03d56f1b2ea0d3e60325f39d703a575" integrity sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA== +get-stream@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + get-symbol-description@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz#7bdd54e0befe8ffc9f3b4e203220d9f1e881b6ee" @@ -7748,6 +7887,11 @@ https-proxy-agent@^7.0.6: agent-base "^7.1.2" debug "4" +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + hyphen@^1.6.4: version "1.10.6" resolved "https://registry.npmjs.org/hyphen/-/hyphen-1.10.6.tgz#0e779d280e696102b97d7e42f5ca5de2cc97e274" @@ -8994,6 +9138,11 @@ mime@1.6.0: resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + mimic-response@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" @@ -9260,6 +9409,13 @@ normalize.css@^8.0.1: resolved "https://registry.npmjs.org/normalize.css/-/normalize.css-8.0.1.tgz#9b98a208738b9cc2634caacbc42d131c97487bf3" integrity sha512-qizSNPO93t1YUuUhP22btGOo3chcvDFqFaj2TRybP0DMxkHOCTYwp3n34fel4a31ORXy4m1Xq0Gyqpb5m33qIg== +npm-run-path@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + nprogress@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz#cb8f34c53213d895723fcbab907e9422adbcafb1" @@ -9403,6 +9559,13 @@ one-time@^1.0.0: dependencies: fn.name "1.x.x" +onetime@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + open@^8.0.4: version "8.4.2" resolved "https://registry.npmjs.org/open/-/open-8.4.2.tgz#5b5ffe2a8f793dcd2aad73e550cb87b59cb084f9" @@ -9585,7 +9748,7 @@ path-is-absolute@^1.0.0: resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== -path-key@^3.1.0: +path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== @@ -10699,6 +10862,11 @@ redlock@^4.2.0: dependencies: bluebird "^3.7.2" +reflect-metadata@*, reflect-metadata@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.2.2.tgz#400c845b6cba87a21f2c65c4aeb158f4fa4d9c5b" + integrity sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q== + reflect.getprototypeof@^1.0.6, reflect.getprototypeof@^1.0.9: version "1.0.10" resolved "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz#c629219e78a3316d8b604c765ef68996964e7bf9" @@ -10903,6 +11071,35 @@ rollup@3.29.5: optionalDependencies: fsevents "~2.3.2" +rollup@^4.19.0: + version "4.37.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.37.0.tgz#e4172f8bdb6ea7df08a1b0acf99abeccb2250378" + integrity sha512-iAtQy/L4QFU+rTJ1YUjXqJOJzuwEghqWzCEYD2FEghT7Gsy1VdABntrO4CLopA5IkflTyqNiLNwPcOJ3S7UKLg== + dependencies: + "@types/estree" "1.0.6" + optionalDependencies: + "@rollup/rollup-android-arm-eabi" "4.37.0" + "@rollup/rollup-android-arm64" "4.37.0" + "@rollup/rollup-darwin-arm64" "4.37.0" + "@rollup/rollup-darwin-x64" "4.37.0" + "@rollup/rollup-freebsd-arm64" "4.37.0" + "@rollup/rollup-freebsd-x64" "4.37.0" + "@rollup/rollup-linux-arm-gnueabihf" "4.37.0" + "@rollup/rollup-linux-arm-musleabihf" "4.37.0" + "@rollup/rollup-linux-arm64-gnu" "4.37.0" + "@rollup/rollup-linux-arm64-musl" "4.37.0" + "@rollup/rollup-linux-loongarch64-gnu" "4.37.0" + "@rollup/rollup-linux-powerpc64le-gnu" "4.37.0" + "@rollup/rollup-linux-riscv64-gnu" "4.37.0" + "@rollup/rollup-linux-riscv64-musl" "4.37.0" + "@rollup/rollup-linux-s390x-gnu" "4.37.0" + "@rollup/rollup-linux-x64-gnu" "4.37.0" + "@rollup/rollup-linux-x64-musl" "4.37.0" + "@rollup/rollup-win32-arm64-msvc" "4.37.0" + "@rollup/rollup-win32-ia32-msvc" "4.37.0" + "@rollup/rollup-win32-x64-msvc" "4.37.0" + fsevents "~2.3.2" + rollup@^4.34.8: version "4.35.0" resolved "https://registry.npmjs.org/rollup/-/rollup-4.35.0.tgz#76c95dba17a579df4c00c3955aed32aa5d4dc66d" @@ -11240,6 +11437,11 @@ side-channel@^1.0.6, side-channel@^1.1.0: side-channel-map "^1.0.1" side-channel-weakmap "^1.0.2" +signal-exit@^3.0.3: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + signal-exit@^4.0.1: version "4.1.0" resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" @@ -11532,6 +11734,11 @@ strip-bom@^3.0.0: resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + strip-indent@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" @@ -11817,7 +12024,7 @@ tinyexec@^0.3.2: resolved "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz#941794e657a85e496577995c6eef66f53f42b3d2" integrity sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA== -tinyglobby@^0.2.11: +tinyglobby@^0.2.1, tinyglobby@^0.2.11: version "0.2.12" resolved "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz#ac941a42e0c5773bd0b5d08f32de82e74a1a61b5" integrity sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww== @@ -11995,6 +12202,28 @@ tslib@~2.5.0: resolved "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz#24944ba2d990940e6e982c4bea147aba80209913" integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w== +tsup@8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/tsup/-/tsup-8.3.0.tgz#c7dae40b13d11d81fb144c0f90077a99102a572a" + integrity sha512-ALscEeyS03IomcuNdFdc0YWGVIkwH1Ws7nfTbAPuoILvEV2hpGQAY72LIOjglGo4ShWpZfpBqP/jpQVCzqYQag== + dependencies: + bundle-require "^5.0.0" + cac "^6.7.14" + chokidar "^3.6.0" + consola "^3.2.3" + debug "^4.3.5" + esbuild "^0.23.0" + execa "^5.1.1" + joycon "^3.1.1" + picocolors "^1.0.1" + postcss-load-config "^6.0.1" + resolve-from "^5.0.0" + rollup "^4.19.0" + source-map "0.8.0-beta.0" + sucrase "^3.35.0" + tinyglobby "^0.2.1" + tree-kill "^1.2.2" + tsup@^8.4.0: version "8.4.0" resolved "https://registry.npmjs.org/tsup/-/tsup-8.4.0.tgz#2fdf537e7abc8f1ccbbbfe4228f16831457d4395" From 6db75fe29c24cb6c6cca6dbfa58e9750ebc211c3 Mon Sep 17 00:00:00 2001 From: Palanikannan M Date: Wed, 26 Mar 2025 00:05:19 +0530 Subject: [PATCH 2/3] fix: added package dependency --- packages/decorators/package.json | 4 +-- .../decorators/src/websocket-controller.ts | 2 +- packages/decorators/tsconfig.json | 15 ++++++----- packages/typescript-config/node-library.json | 26 +++++++++++++++++++ packages/typescript-config/package.json | 3 ++- 5 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 packages/typescript-config/node-library.json diff --git a/packages/decorators/package.json b/packages/decorators/package.json index 9d2563b7c2e..013dcac5f83 100644 --- a/packages/decorators/package.json +++ b/packages/decorators/package.json @@ -17,7 +17,8 @@ "lint:errors": "eslint src --ext .ts,.tsx --quiet" }, "dependencies": { - "reflect-metadata": "^0.2.2" + "reflect-metadata": "^0.2.2", + "express": "^4.21.2" }, "devDependencies": { "@plane/eslint-config": "*", @@ -26,7 +27,6 @@ "@plane/typescript-config": "*", "@types/node": "^20.14.9", "@types/ws": "^8.5.10", - "express": "^4.21.2", "tsup": "8.3.0", "typescript": "^5.3.3" }, diff --git a/packages/decorators/src/websocket-controller.ts b/packages/decorators/src/websocket-controller.ts index 3b5c04ad07a..85a018da087 100644 --- a/packages/decorators/src/websocket-controller.ts +++ b/packages/decorators/src/websocket-controller.ts @@ -1,4 +1,4 @@ -import type { Router, Request } from "express"; +import { Router, Request } from "express"; import type { WebSocket } from "ws"; import "reflect-metadata"; diff --git a/packages/decorators/tsconfig.json b/packages/decorators/tsconfig.json index 16a7a8c802e..02b459b9f66 100644 --- a/packages/decorators/tsconfig.json +++ b/packages/decorators/tsconfig.json @@ -1,11 +1,14 @@ { - "extends": "@plane/typescript-config/react-library.json", + "extends": "@plane/typescript-config/node-library.json", "compilerOptions": { - "jsx": "react", - "lib": [ - "esnext", - "dom" - ], + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "lib": ["ES2020"], + "rootDir": ".", + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] + } }, "include": [ "./src" diff --git a/packages/typescript-config/node-library.json b/packages/typescript-config/node-library.json new file mode 100644 index 00000000000..afb41eff3bd --- /dev/null +++ b/packages/typescript-config/node-library.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "display": "Node.js Library", + "extends": "./base.json", + "compilerOptions": { + "module": "NodeNext", + "moduleResolution": "NodeNext", + "target": "ES2020", + "lib": ["ES2020"], + "outDir": "./dist", + "rootDir": "./src", + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] + }, + "sourceMap": true, + "inlineSources": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "build"] +} \ No newline at end of file diff --git a/packages/typescript-config/package.json b/packages/typescript-config/package.json index cac5df87334..914fef03ae4 100644 --- a/packages/typescript-config/package.json +++ b/packages/typescript-config/package.json @@ -6,6 +6,7 @@ "files": [ "base.json", "nextjs.json", - "react-library.json" + "react-library.json", + "node-library.json" ] } From 8a9cdc613387e43aee9d374d24bf9e7b7113650c Mon Sep 17 00:00:00 2001 From: Palanikannan M Date: Wed, 26 Mar 2025 13:59:28 +0530 Subject: [PATCH 3/3] fix: refactor decorators --- packages/decorators/src/rest.ts | 98 ++++++++------------------------- 1 file changed, 24 insertions(+), 74 deletions(-) diff --git a/packages/decorators/src/rest.ts b/packages/decorators/src/rest.ts index b34b3a83455..68c0fba5457 100644 --- a/packages/decorators/src/rest.ts +++ b/packages/decorators/src/rest.ts @@ -1,6 +1,9 @@ import "reflect-metadata"; import { RequestHandler } from "express"; +// Define valid HTTP methods +type RestMethod = "get" | "post" | "put" | "patch" | "delete"; + /** * Controller decorator * @param baseRoute @@ -13,84 +16,31 @@ export function Controller(baseRoute: string = ""): ClassDecorator { } /** - * Controller GET method decorator - * @param route - * @returns - */ -export function Get(route: string): MethodDecorator { - return function ( - target: object, - propertyKey: string | symbol, - descriptor: PropertyDescriptor, - ) { - Reflect.defineMetadata("method", "get", target, propertyKey); - Reflect.defineMetadata("route", route, target, propertyKey); - }; -} - -/** - * Controller POST method decorator - * @param route - * @returns - */ -export function Post(route: string): MethodDecorator { - return function ( - target: object, - propertyKey: string | symbol, - descriptor: PropertyDescriptor, - ) { - Reflect.defineMetadata("method", "post", target, propertyKey); - Reflect.defineMetadata("route", route, target, propertyKey); - }; -} - -/** - * Controller PATCH method decorator - * @param route - * @returns - */ -export function Patch(route: string): MethodDecorator { - return function ( - target: object, - propertyKey: string | symbol, - descriptor: PropertyDescriptor, - ) { - Reflect.defineMetadata("method", "patch", target, propertyKey); - Reflect.defineMetadata("route", route, target, propertyKey); - }; -} - -/** - * Controller PUT method decorator - * @param route - * @returns + * Factory function to create HTTP method decorators + * @param method HTTP method to handle + * @returns Method decorator */ -export function Put(route: string): MethodDecorator { - return function ( - target: object, - propertyKey: string | symbol, - descriptor: PropertyDescriptor, - ) { - Reflect.defineMetadata("method", "put", target, propertyKey); - Reflect.defineMetadata("route", route, target, propertyKey); +function createHttpMethodDecorator( + method: RestMethod +): (route: string) => MethodDecorator { + return function (route: string): MethodDecorator { + return function ( + target: object, + propertyKey: string | symbol, + descriptor: PropertyDescriptor + ) { + Reflect.defineMetadata("method", method, target, propertyKey); + Reflect.defineMetadata("route", route, target, propertyKey); + }; }; } -/** - * Controller DELETE method decorator - * @param route - * @returns - */ -export function Delete(route: string): MethodDecorator { - return function ( - target: object, - propertyKey: string | symbol, - descriptor: PropertyDescriptor, - ) { - Reflect.defineMetadata("method", "delete", target, propertyKey); - Reflect.defineMetadata("route", route, target, propertyKey); - }; -} +// Export HTTP method decorators using the factory +export const Get = createHttpMethodDecorator("get"); +export const Post = createHttpMethodDecorator("post"); +export const Put = createHttpMethodDecorator("put"); +export const Patch = createHttpMethodDecorator("patch"); +export const Delete = createHttpMethodDecorator("delete"); /** * Middleware decorator