Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"pnpm": ">=7.5.1"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"types": "src/index.ts",
"scripts": {
"build": "turbo run build",
"build:clean": "turbo run clean:build",
Expand Down
1 change: 0 additions & 1 deletion packages/authorization/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @type {import('jest').Config} */
module.exports = {
transform: {
"^.+\\.(t|j)sx?$": "@swc/jest",
Expand Down
4 changes: 2 additions & 2 deletions packages/authorization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"publishConfig": {
"access": "public"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "src/index.js",
"types": "src/index.ts",
"scripts": {
"build": "tsc -p tsconfig.build.json",
"clean:build": "rimraf ./dist",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function EnableAuthorization(
CurrentUserCheckerClass?: new () => CurrentUserChecker,
AuthorizationCheckerClass?: new () => AuthorizationChecker,
): Function {
return function (object: Function) {
return function () {
if (AuthorizationCheckerClass) {
ApplicationContext.get().authorizationChecker = new AuthorizationCheckerClass();
}
Expand Down
1 change: 0 additions & 1 deletion packages/config/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @type {import('jest').Config} */
module.exports = {
transform: {
"^.+\\.(t|j)sx?$": "@swc/jest",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"access": "public"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"types": "src/index.ts",
"scripts": {
"build": "tsc -p tsconfig.build.json",
"clean:build": "rimraf ./dist",
Expand Down
1 change: 0 additions & 1 deletion packages/context/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @type {import('jest').Config} */
module.exports = {
transform: {
"^.+\\.(t|j)sx?$": "@swc/jest",
Expand Down
2 changes: 1 addition & 1 deletion packages/context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"access": "public"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"types": "src/index.ts",
"scripts": {
"build": "tsc -p tsconfig.build.json",
"clean:build": "rimraf ./dist",
Expand Down
1 change: 0 additions & 1 deletion packages/core/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @type {import('jest').Config} */
module.exports = {
transform: {
"^.+\\.(t|j)sx?$": "@swc/jest",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"access": "public"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"types": "src/index.ts",
"scripts": {
"build": "tsc -p tsconfig.build.json",
"clean:build": "rimraf ./dist",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/decorators/Configurations.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function Configurations(configurationClasses: (new (...args: any[]) => any)[]): Function {
return function (target: any) {
return function () {
configurationClasses.map(ClassConstructor => new ClassConstructor());
};
}
2 changes: 1 addition & 1 deletion packages/core/src/decorators/Controllers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {ApplicationContext} from "@node-boot/context";

export function Controllers(controllers: Function[]): Function {
return function (target: any) {
return function () {
ApplicationContext.get().controllerClasses = controllers;
};
}
37 changes: 0 additions & 37 deletions packages/core/src/decorators/EnableAutoConfiguration.ts

This file was deleted.

6 changes: 3 additions & 3 deletions packages/core/src/decorators/EnableClassTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ import {ApplicationContext, TransformerOptions} from "@node-boot/context";
import {ClassTransformOptions} from "class-transformer";

export function ClassToPlainTransform(options: ClassTransformOptions): Function {
return function (target: Function) {
return function () {
ApplicationContext.get().classToPlainTransformOptions = options;
};
}

export function PlainToClassTransform(options: ClassTransformOptions): Function {
return function (target: Function) {
return function () {
ApplicationContext.get().plainToClassTransformOptions = options;
};
}

export function EnableClassTransformer(options?: TransformerOptions): Function {
return function (target: Function) {
return function () {
ApplicationContext.get().classTransformer = options?.enabled ?? true;

ApplicationContext.get().classToPlainTransformOptions = options?.classToPlain;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/decorators/EnableComponentScan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {ApplicationContext, ComponentScanOptions} from "@node-boot/context";
import path from "path";

export function EnableComponentScan(options?: ComponentScanOptions): Function {
return function (object: Function) {
return function () {
options = options ?? {
controllerPaths: ["/controllers"],
middlewarePaths: ["/middlewares"],
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/decorators/GlobalMiddlewares.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {ApplicationContext} from "@node-boot/context";

export function GlobalMiddlewares(middlewares: Function[]): Function {
return function (target: any) {
return function () {
ApplicationContext.get().globalMiddlewares = middlewares;
};
}
2 changes: 1 addition & 1 deletion packages/core/src/decorators/Interceptors.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {ApplicationContext} from "@node-boot/context";

export function Interceptors(interceptors: Function[]): Function {
return function (target: any) {
return function () {
ApplicationContext.get().interceptorClasses = interceptors;
};
}
1 change: 0 additions & 1 deletion packages/core/src/decorators/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export * from "./CookieParam";
export * from "./CookieParams";
export * from "./Ctx";
export * from "./Delete";
export * from "./EnableAutoConfiguration";
export * from "./EnableClassTransformer";
export * from "./EnableComponentScan";
export * from "./ErrorHandler";
Expand Down
1 change: 0 additions & 1 deletion packages/di/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @type {import('jest').Config} */
module.exports = {
transform: {
"^.+\\.(t|j)sx?$": "@swc/jest",
Expand Down
2 changes: 1 addition & 1 deletion packages/di/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"access": "public"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"types": "src/index.ts",
"scripts": {
"build": "tsc -p tsconfig.build.json",
"clean:build": "rimraf ./dist",
Expand Down
2 changes: 1 addition & 1 deletion packages/di/src/decorators/EnableDI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {ApplicationContext, IocContainer, UseContainerOptions} from "@node-boot/
* @param options Extra options for the IOC container
*/
export function EnableDI<TContainer>(iocContainer: IocContainer<TContainer>, options?: UseContainerOptions): Function {
return function (object: Function) {
return function () {
ApplicationContext.get().diOptions = {
iocContainer,
options,
Expand Down
2 changes: 0 additions & 2 deletions packages/di/src/decorators/Inject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ export function Inject(options?: InjectionOptions): Function {
return (target: Object, propertyName: string | Symbol, index?: number) => {
// Registering metadata for custom filed injection (used for example in the Persistence Event Subscribers)
if (propertyName && typeof propertyName === "string") {
const propertyType = Reflect.getMetadata("design:type", target, propertyName);
const injectProperties: string[] = Reflect.getMetadata(REQUIRES_FIELD_INJECTION_KEY, target) || [];
injectProperties.push(propertyName);
Reflect.defineMetadata(REQUIRES_FIELD_INJECTION_KEY, injectProperties, target);
}

// Normal injection
decorateInjection(target, propertyName, index, options);
};
Expand Down
1 change: 0 additions & 1 deletion packages/engine/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @type {import('jest').Config} */
module.exports = {
transform: {
"^.+\\.(t|j)sx?$": "@swc/jest",
Expand Down
4 changes: 2 additions & 2 deletions packages/engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"publishConfig": {
"access": "public"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "src/index.js",
"types": "src/index.ts",
"scripts": {
"build": "tsc -p tsconfig.build.json",
"clean:build": "rimraf ./dist",
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/src/core/NodeBootDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export abstract class NodeBootDriver<TServer, TAction extends Action = Action> {
*/
currentUserChecker?: CurrentUserChecker;

protected transformResult(result: any, actionMetadata: ActionMetadata, action: TAction): any {
protected transformResult<T = unknown>(result: any, actionMetadata: ActionMetadata): T {
// check if we need to transform result
const shouldTransform =
this.useClassTransformer && // transform only if class-transformer is enabled
Expand Down
1 change: 0 additions & 1 deletion packages/error/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @type {import('jest').Config} */
module.exports = {
transform: {
"^.+\\.(t|j)sx?$": "@swc/jest",
Expand Down
4 changes: 2 additions & 2 deletions packages/error/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"publishConfig": {
"access": "public"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "src/index.js",
"types": "src/index.ts",
"scripts": {
"build": "tsc -p tsconfig.build.json",
"clean:build": "rimraf ./dist",
Expand Down
1 change: 0 additions & 1 deletion packages/extension/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @type {import('jest').Config} */
module.exports = {
transform: {
"^.+\\.(t|j)sx?$": "@swc/jest",
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"access": "public"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"types": "src/index.ts",
"scripts": {
"build": "tsc -p tsconfig.build.json",
"clean:build": "rimraf ./dist",
Expand Down
4 changes: 2 additions & 2 deletions packages/extension/src/Optional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ export class Optional<T> {
return Optional.of(this.value.filter(predicate) as T);
} else if (this.value instanceof Map || this.value instanceof Set) {
// Filter map or set
const filteredEntries = Array.from(this.value.entries()).filter(([key, value]) => predicate(value));
const filteredEntries = Array.from(this.value.entries()).filter(([, value]) => predicate(value));
if (this.value instanceof Map) {
return Optional.of(new Map(filteredEntries) as T);
} else {
return Optional.of(new Set(filteredEntries.map(([key, value]) => value)) as T);
return Optional.of(new Set(filteredEntries.map(([, value]) => value)) as T);
}
} else {
// Filter single value
Expand Down
1 change: 0 additions & 1 deletion packages/openapi/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @type {import('jest').Config} */
module.exports = {
transform: {
"^.+\\.(t|j)sx?$": "@swc/jest",
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"access": "public"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"types": "src/index.ts",
"scripts": {
"build": "tsc -p tsconfig.build.json",
"clean:build": "rimraf ./dist",
Expand Down
3 changes: 2 additions & 1 deletion packages/openapi/src/adapter/ExpressOpenApi.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import {OpenApiAdapter, OpenApiOptions} from "@node-boot/context";
import swaggerUi from "swagger-ui-express";
import {OpenApiSpecAdapter} from "./OpenApiSpecAdapter";
import {Response} from "express";

export class ExpressOpenApi implements OpenApiAdapter {
bind(openApiOptions: OpenApiOptions, server: any, router: any): void {
if (swaggerUi?.serve) {
const {spec, options} = OpenApiSpecAdapter.adapt(openApiOptions);

router.get(options.swaggerOptions.url, (req, res) => res.json(spec));
router.get(options.swaggerOptions.url, (_: never, res: Response) => res.json(spec));
server.use("/api-docs", swaggerUi.serve, swaggerUi.setup(spec, options));
} else {
throw new Error(
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi/src/adapter/FastifyOpenApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class FastifyOpenApi implements OpenApiAdapter {
bind(openApiOptions: OpenApiOptions, server: FastifyInstance, router: FastifyInstance): void {
const {spec, options} = OpenApiSpecAdapter.adapt(openApiOptions);

router.get(options.swaggerOptions.url, async (request, reply) => {
router.get(options.swaggerOptions.url, async (_, reply) => {
reply.send(spec);
});
server.register(require("@fastify/swagger"), {
Expand Down
6 changes: 3 additions & 3 deletions packages/openapi/src/decorator/EnableOpenApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {FastifyOpenApi} from "../adapter/FastifyOpenApi";
/**
* Defines the configurations to enable Swagger Open API
*
* @param openApi The OpenAPI definitions and base config
* @param _ The OpenAPI definitions and base config
*/
export function EnableOpenApi(openApi: Partial<oa.OpenAPIObject> = {}): Function {
return function (object: Function) {
export function EnableOpenApi(_: Partial<oa.OpenAPIObject> = {}): Function {
return function () {
ApplicationContext.get().openApi = new (class implements OpenApiBridgeAdapter {
bind(serverType: string): OpenApiAdapter {
switch (serverType) {
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi/src/decorator/OpenAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {OpenAPI as InnerOpenAPI} from "routing-controllers-openapi";
* returning an updated Operation.
*/
export function OpenAPI(...args: Parameters<typeof InnerOpenAPI>) {
return <TFunction extends Function>(...innerArgs: [Function] | [object, string, PropertyDescriptor]) => {
return (...innerArgs: [Function] | [object, string, PropertyDescriptor]) => {
InnerOpenAPI(...args)(...innerArgs);
};
}
14 changes: 13 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion samples/sample-express/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @type {import('jest').Config} */
module.exports = {
transform: {
"^.+\\.(t|j)sx?$": "@swc/jest",
Expand Down
Loading