diff --git a/apps/chat-app/src/chat-app.controller.spec.ts b/apps/chat-app/src/chat-app.controller.spec.ts new file mode 100644 index 0000000..3a82994 --- /dev/null +++ b/apps/chat-app/src/chat-app.controller.spec.ts @@ -0,0 +1,22 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { ChatAppController } from './chat-app.controller'; +import { ChatAppService } from './chat-app.service'; + +describe('ChatAppController', () => { + let chatAppController: ChatAppController; + + beforeEach(async () => { + const app: TestingModule = await Test.createTestingModule({ + controllers: [ChatAppController], + providers: [ChatAppService], + }).compile(); + + chatAppController = app.get(ChatAppController); + }); + + describe('root', () => { + it('should return "Hello World!"', () => { + expect(chatAppController.getHello()).toBe('Hello World!'); + }); + }); +}); diff --git a/apps/chat-app/src/chat-app.controller.ts b/apps/chat-app/src/chat-app.controller.ts new file mode 100644 index 0000000..ce06e2f --- /dev/null +++ b/apps/chat-app/src/chat-app.controller.ts @@ -0,0 +1,12 @@ +import { Controller, Get } from '@nestjs/common'; +import { ChatAppService } from './chat-app.service'; + +@Controller() +export class ChatAppController { + constructor(private readonly chatAppService: ChatAppService) {} + + @Get() + getHello(): string { + return this.chatAppService.getHello(); + } +} diff --git a/apps/chat-app/src/chat-app.module.ts b/apps/chat-app/src/chat-app.module.ts new file mode 100644 index 0000000..36a0a62 --- /dev/null +++ b/apps/chat-app/src/chat-app.module.ts @@ -0,0 +1,10 @@ +import { Module } from '@nestjs/common'; +import { ChatAppController } from './chat-app.controller'; +import { ChatAppService } from './chat-app.service'; + +@Module({ + imports: [], + controllers: [ChatAppController], + providers: [ChatAppService], +}) +export class ChatAppModule {} diff --git a/apps/chat-app/src/chat-app.service.ts b/apps/chat-app/src/chat-app.service.ts new file mode 100644 index 0000000..4bbb725 --- /dev/null +++ b/apps/chat-app/src/chat-app.service.ts @@ -0,0 +1,8 @@ +import { Injectable } from '@nestjs/common'; + +@Injectable() +export class ChatAppService { + getHello(): string { + return 'Hello World!'; + } +} diff --git a/apps/chat-app/src/main.ts b/apps/chat-app/src/main.ts new file mode 100644 index 0000000..8d83af9 --- /dev/null +++ b/apps/chat-app/src/main.ts @@ -0,0 +1,8 @@ +import { NestFactory } from '@nestjs/core'; +import { ChatAppModule } from './chat-app.module'; + +async function bootstrap() { + const app = await NestFactory.create(ChatAppModule); + await app.listen(3000); +} +bootstrap(); diff --git a/apps/chat-app/test/app.e2e-spec.ts b/apps/chat-app/test/app.e2e-spec.ts new file mode 100644 index 0000000..56cd278 --- /dev/null +++ b/apps/chat-app/test/app.e2e-spec.ts @@ -0,0 +1,24 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { INestApplication } from '@nestjs/common'; +import * as request from 'supertest'; +import { ChatAppModule } from './../src/chat-app.module'; + +describe('ChatAppController (e2e)', () => { + let app: INestApplication; + + beforeEach(async () => { + const moduleFixture: TestingModule = await Test.createTestingModule({ + imports: [ChatAppModule], + }).compile(); + + app = moduleFixture.createNestApplication(); + await app.init(); + }); + + it('/ (GET)', () => { + return request(app.getHttpServer()) + .get('/') + .expect(200) + .expect('Hello World!'); + }); +}); diff --git a/test/jest-e2e.json b/apps/chat-app/test/jest-e2e.json similarity index 100% rename from test/jest-e2e.json rename to apps/chat-app/test/jest-e2e.json diff --git a/apps/chat-app/tsconfig.app.json b/apps/chat-app/tsconfig.app.json new file mode 100644 index 0000000..66a0d1d --- /dev/null +++ b/apps/chat-app/tsconfig.app.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "declaration": false, + "outDir": "../../dist/apps/chat-app" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] +} diff --git a/src/app.controller.spec.ts b/apps/nestjs-be-app/src/app.controller.spec.ts similarity index 100% rename from src/app.controller.spec.ts rename to apps/nestjs-be-app/src/app.controller.spec.ts diff --git a/src/app.controller.ts b/apps/nestjs-be-app/src/app.controller.ts similarity index 100% rename from src/app.controller.ts rename to apps/nestjs-be-app/src/app.controller.ts diff --git a/src/app.module.ts b/apps/nestjs-be-app/src/app.module.ts similarity index 100% rename from src/app.module.ts rename to apps/nestjs-be-app/src/app.module.ts diff --git a/src/app.service.ts b/apps/nestjs-be-app/src/app.service.ts similarity index 100% rename from src/app.service.ts rename to apps/nestjs-be-app/src/app.service.ts diff --git a/src/config/env.ts b/apps/nestjs-be-app/src/config/env.ts similarity index 100% rename from src/config/env.ts rename to apps/nestjs-be-app/src/config/env.ts diff --git a/src/constants/entity.ts b/apps/nestjs-be-app/src/constants/entity.ts similarity index 100% rename from src/constants/entity.ts rename to apps/nestjs-be-app/src/constants/entity.ts diff --git a/src/constants/messages.ts b/apps/nestjs-be-app/src/constants/messages.ts similarity index 100% rename from src/constants/messages.ts rename to apps/nestjs-be-app/src/constants/messages.ts diff --git a/src/constants/users.ts b/apps/nestjs-be-app/src/constants/users.ts similarity index 100% rename from src/constants/users.ts rename to apps/nestjs-be-app/src/constants/users.ts diff --git a/src/db.module.ts b/apps/nestjs-be-app/src/db.module.ts similarity index 100% rename from src/db.module.ts rename to apps/nestjs-be-app/src/db.module.ts diff --git a/src/decorators/user.decorator.ts b/apps/nestjs-be-app/src/decorators/user.decorator.ts similarity index 100% rename from src/decorators/user.decorator.ts rename to apps/nestjs-be-app/src/decorators/user.decorator.ts diff --git a/src/dtos/response.ts b/apps/nestjs-be-app/src/dtos/response.ts similarity index 100% rename from src/dtos/response.ts rename to apps/nestjs-be-app/src/dtos/response.ts diff --git a/src/entities/index.ts b/apps/nestjs-be-app/src/entities/index.ts similarity index 100% rename from src/entities/index.ts rename to apps/nestjs-be-app/src/entities/index.ts diff --git a/src/main.ts b/apps/nestjs-be-app/src/main.ts similarity index 98% rename from src/main.ts rename to apps/nestjs-be-app/src/main.ts index d3768b0..aa6723d 100644 --- a/src/main.ts +++ b/apps/nestjs-be-app/src/main.ts @@ -62,7 +62,7 @@ async function bootstrap() { await app.register(fastifyCsrf); // eslint-disable-next-line @typescript-eslint/no-var-requires - const appData = require('../package.json'); + const appData = require('../../../package.json'); const name = appData.name || ''; const version = appData.version || ''; const description = appData.description || ''; diff --git a/src/middlewares/auth.guard.ts b/apps/nestjs-be-app/src/middlewares/auth.guard.ts similarity index 89% rename from src/middlewares/auth.guard.ts rename to apps/nestjs-be-app/src/middlewares/auth.guard.ts index ac063bc..a048228 100644 --- a/src/middlewares/auth.guard.ts +++ b/apps/nestjs-be-app/src/middlewares/auth.guard.ts @@ -5,8 +5,8 @@ import { UnauthorizedException, } from '@nestjs/common'; import { Observable } from 'rxjs'; -import { getEnv } from 'src/config/env'; -import { UsersUtils } from 'src/utils/users.util'; +import { getEnv } from '../config/env'; +import { UsersUtils } from '../utils/users.util'; @Injectable() export class AuthGuard implements CanActivate { diff --git a/src/middlewares/http-exception.filter.ts b/apps/nestjs-be-app/src/middlewares/http-exception.filter.ts similarity index 100% rename from src/middlewares/http-exception.filter.ts rename to apps/nestjs-be-app/src/middlewares/http-exception.filter.ts diff --git a/src/middlewares/logger.middleware.ts b/apps/nestjs-be-app/src/middlewares/logger.middleware.ts similarity index 100% rename from src/middlewares/logger.middleware.ts rename to apps/nestjs-be-app/src/middlewares/logger.middleware.ts diff --git a/src/modules/health/health.controller.spec.ts b/apps/nestjs-be-app/src/modules/health/health.controller.spec.ts similarity index 100% rename from src/modules/health/health.controller.spec.ts rename to apps/nestjs-be-app/src/modules/health/health.controller.spec.ts diff --git a/src/modules/health/health.controller.ts b/apps/nestjs-be-app/src/modules/health/health.controller.ts similarity index 100% rename from src/modules/health/health.controller.ts rename to apps/nestjs-be-app/src/modules/health/health.controller.ts diff --git a/src/modules/health/health.module.ts b/apps/nestjs-be-app/src/modules/health/health.module.ts similarity index 100% rename from src/modules/health/health.module.ts rename to apps/nestjs-be-app/src/modules/health/health.module.ts diff --git a/src/modules/users/dtos/users-request.dto.ts b/apps/nestjs-be-app/src/modules/users/dtos/users-request.dto.ts similarity index 97% rename from src/modules/users/dtos/users-request.dto.ts rename to apps/nestjs-be-app/src/modules/users/dtos/users-request.dto.ts index 546100a..aed86c2 100644 --- a/src/modules/users/dtos/users-request.dto.ts +++ b/apps/nestjs-be-app/src/modules/users/dtos/users-request.dto.ts @@ -1,6 +1,6 @@ import { ApiProperty } from '@nestjs/swagger'; import { IsEmail, IsOptional, IsNotEmpty, IsIn } from 'class-validator'; -import { ROLE } from 'src/constants/users'; +import { ROLE } from '../../../constants/users'; export class CreateUserDto { @IsOptional() diff --git a/src/modules/users/dtos/users-response.dto.ts b/apps/nestjs-be-app/src/modules/users/dtos/users-response.dto.ts similarity index 84% rename from src/modules/users/dtos/users-response.dto.ts rename to apps/nestjs-be-app/src/modules/users/dtos/users-response.dto.ts index 13aecf1..05688f2 100644 --- a/src/modules/users/dtos/users-response.dto.ts +++ b/apps/nestjs-be-app/src/modules/users/dtos/users-response.dto.ts @@ -1,4 +1,4 @@ -import { ResponseDTO } from 'src/dtos/response'; +import { ResponseDTO } from '../../../dtos/response'; export class LoginResponse extends ResponseDTO { accessToken?: string; diff --git a/src/modules/users/user.entity.ts b/apps/nestjs-be-app/src/modules/users/user.entity.ts similarity index 100% rename from src/modules/users/user.entity.ts rename to apps/nestjs-be-app/src/modules/users/user.entity.ts diff --git a/src/modules/users/users.controller.spec.ts b/apps/nestjs-be-app/src/modules/users/users.controller.spec.ts similarity index 100% rename from src/modules/users/users.controller.spec.ts rename to apps/nestjs-be-app/src/modules/users/users.controller.spec.ts diff --git a/src/modules/users/users.controller.ts b/apps/nestjs-be-app/src/modules/users/users.controller.ts similarity index 92% rename from src/modules/users/users.controller.ts rename to apps/nestjs-be-app/src/modules/users/users.controller.ts index 0439788..f2eea1e 100644 --- a/src/modules/users/users.controller.ts +++ b/apps/nestjs-be-app/src/modules/users/users.controller.ts @@ -8,9 +8,9 @@ import { UseGuards, } from '@nestjs/common'; import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; -import { UserEmail, UserId } from 'src/decorators/user.decorator'; -import { ResponseDTO } from 'src/dtos/response'; -import { AuthGuard } from 'src/middlewares/auth.guard'; +import { UserEmail, UserId } from '../../decorators/user.decorator'; +import { ResponseDTO } from '../../dtos/response'; +import { AuthGuard } from '../../middlewares/auth.guard'; import { CreateUserDto, LoginUserDto, diff --git a/src/modules/users/users.module.ts b/apps/nestjs-be-app/src/modules/users/users.module.ts similarity index 88% rename from src/modules/users/users.module.ts rename to apps/nestjs-be-app/src/modules/users/users.module.ts index 3e37705..05969e2 100644 --- a/src/modules/users/users.module.ts +++ b/apps/nestjs-be-app/src/modules/users/users.module.ts @@ -3,7 +3,7 @@ import { UsersController } from './users.controller'; import { UsersService } from './users.service'; import { usersProviders } from './users.providers'; import { DatabaseModule } from '../../db.module'; -import { UsersUtils } from 'src/utils/users.util'; +import { UsersUtils } from '../../utils/users.util'; @Module({ imports: [DatabaseModule], diff --git a/src/modules/users/users.providers.ts b/apps/nestjs-be-app/src/modules/users/users.providers.ts similarity index 69% rename from src/modules/users/users.providers.ts rename to apps/nestjs-be-app/src/modules/users/users.providers.ts index 2e22777..801d8c3 100644 --- a/src/modules/users/users.providers.ts +++ b/apps/nestjs-be-app/src/modules/users/users.providers.ts @@ -1,4 +1,4 @@ -import { USERS_REPOSITORY } from 'src/constants/entity'; +import { USERS_REPOSITORY } from '../../constants/entity'; import { User } from './user.entity'; export const usersProviders = [ diff --git a/src/modules/users/users.service.spec.ts b/apps/nestjs-be-app/src/modules/users/users.service.spec.ts similarity index 100% rename from src/modules/users/users.service.spec.ts rename to apps/nestjs-be-app/src/modules/users/users.service.spec.ts diff --git a/src/modules/users/users.service.ts b/apps/nestjs-be-app/src/modules/users/users.service.ts similarity index 95% rename from src/modules/users/users.service.ts rename to apps/nestjs-be-app/src/modules/users/users.service.ts index 7705f4b..a84e9b0 100644 --- a/src/modules/users/users.service.ts +++ b/apps/nestjs-be-app/src/modules/users/users.service.ts @@ -7,11 +7,11 @@ import { UpdateUserPasswordDto, } from './dtos/users-request.dto'; import { User } from './user.entity'; -import { STATUS } from 'src/constants/users'; -import MESSAGES from 'src/constants/messages'; -import { USERS_REPOSITORY } from 'src/constants/entity'; -import { UsersUtils } from 'src/utils/users.util'; -import { getEnv } from 'src/config/env'; +import { STATUS } from '../../constants/users'; +import MESSAGES from '../../constants/messages'; +import { USERS_REPOSITORY } from '../../constants/entity'; +import { UsersUtils } from '../../utils/users.util'; +import { getEnv } from '../../config/env'; import { LoginResponse } from './dtos/users-response.dto'; @Injectable() diff --git a/src/providers/db.providers.ts b/apps/nestjs-be-app/src/providers/db.providers.ts similarity index 93% rename from src/providers/db.providers.ts rename to apps/nestjs-be-app/src/providers/db.providers.ts index 709b52a..6bf0622 100644 --- a/src/providers/db.providers.ts +++ b/apps/nestjs-be-app/src/providers/db.providers.ts @@ -1,5 +1,5 @@ import { Sequelize } from 'sequelize-typescript'; -import { getEnv, isLocalDev } from 'src/config/env'; +import { getEnv, isLocalDev } from '../config/env'; import entities from '../entities'; export const databaseProviders = [ diff --git a/src/utils/users.util.ts b/apps/nestjs-be-app/src/utils/users.util.ts similarity index 97% rename from src/utils/users.util.ts rename to apps/nestjs-be-app/src/utils/users.util.ts index a10d28c..7c95b20 100644 --- a/src/utils/users.util.ts +++ b/apps/nestjs-be-app/src/utils/users.util.ts @@ -2,7 +2,7 @@ import { v4 as uuidv4 } from 'uuid'; import * as crypto from 'crypto'; import * as jwt from 'jsonwebtoken'; import { UnauthorizedException } from '@nestjs/common/exceptions'; -import { getEnv } from 'src/config/env'; +import { getEnv } from '../config/env'; export class UsersUtils { createSalt() { diff --git a/test/app.e2e-spec.ts b/apps/nestjs-be-app/test/app.e2e-spec.ts similarity index 100% rename from test/app.e2e-spec.ts rename to apps/nestjs-be-app/test/app.e2e-spec.ts diff --git a/apps/nestjs-be-app/test/jest-e2e.json b/apps/nestjs-be-app/test/jest-e2e.json new file mode 100644 index 0000000..e9d912f --- /dev/null +++ b/apps/nestjs-be-app/test/jest-e2e.json @@ -0,0 +1,9 @@ +{ + "moduleFileExtensions": ["js", "json", "ts"], + "rootDir": ".", + "testEnvironment": "node", + "testRegex": ".e2e-spec.ts$", + "transform": { + "^.+\\.(t|j)s$": "ts-jest" + } +} diff --git a/apps/nestjs-be-app/tsconfig.app.json b/apps/nestjs-be-app/tsconfig.app.json new file mode 100644 index 0000000..3daa22e --- /dev/null +++ b/apps/nestjs-be-app/tsconfig.app.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "declaration": false, + "outDir": "../../dist/apps/nestjs-be-app" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] +} diff --git a/apps/notification-app/src/main.ts b/apps/notification-app/src/main.ts new file mode 100644 index 0000000..3f57b66 --- /dev/null +++ b/apps/notification-app/src/main.ts @@ -0,0 +1,8 @@ +import { NestFactory } from '@nestjs/core'; +import { NotificationAppModule } from './notification-app.module'; + +async function bootstrap() { + const app = await NestFactory.create(NotificationAppModule); + await app.listen(3000); +} +bootstrap(); diff --git a/apps/notification-app/src/notification-app.controller.spec.ts b/apps/notification-app/src/notification-app.controller.spec.ts new file mode 100644 index 0000000..1d1f730 --- /dev/null +++ b/apps/notification-app/src/notification-app.controller.spec.ts @@ -0,0 +1,22 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { NotificationAppController } from './notification-app.controller'; +import { NotificationAppService } from './notification-app.service'; + +describe('NotificationAppController', () => { + let notificationAppController: NotificationAppController; + + beforeEach(async () => { + const app: TestingModule = await Test.createTestingModule({ + controllers: [NotificationAppController], + providers: [NotificationAppService], + }).compile(); + + notificationAppController = app.get(NotificationAppController); + }); + + describe('root', () => { + it('should return "Hello World!"', () => { + expect(notificationAppController.getHello()).toBe('Hello World!'); + }); + }); +}); diff --git a/apps/notification-app/src/notification-app.controller.ts b/apps/notification-app/src/notification-app.controller.ts new file mode 100644 index 0000000..a653587 --- /dev/null +++ b/apps/notification-app/src/notification-app.controller.ts @@ -0,0 +1,12 @@ +import { Controller, Get } from '@nestjs/common'; +import { NotificationAppService } from './notification-app.service'; + +@Controller() +export class NotificationAppController { + constructor(private readonly notificationAppService: NotificationAppService) {} + + @Get() + getHello(): string { + return this.notificationAppService.getHello(); + } +} diff --git a/apps/notification-app/src/notification-app.module.ts b/apps/notification-app/src/notification-app.module.ts new file mode 100644 index 0000000..fc5aab1 --- /dev/null +++ b/apps/notification-app/src/notification-app.module.ts @@ -0,0 +1,10 @@ +import { Module } from '@nestjs/common'; +import { NotificationAppController } from './notification-app.controller'; +import { NotificationAppService } from './notification-app.service'; + +@Module({ + imports: [], + controllers: [NotificationAppController], + providers: [NotificationAppService], +}) +export class NotificationAppModule {} diff --git a/apps/notification-app/src/notification-app.service.ts b/apps/notification-app/src/notification-app.service.ts new file mode 100644 index 0000000..a9c6afe --- /dev/null +++ b/apps/notification-app/src/notification-app.service.ts @@ -0,0 +1,8 @@ +import { Injectable } from '@nestjs/common'; + +@Injectable() +export class NotificationAppService { + getHello(): string { + return 'Hello World!'; + } +} diff --git a/apps/notification-app/test/app.e2e-spec.ts b/apps/notification-app/test/app.e2e-spec.ts new file mode 100644 index 0000000..3f484bf --- /dev/null +++ b/apps/notification-app/test/app.e2e-spec.ts @@ -0,0 +1,24 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { INestApplication } from '@nestjs/common'; +import * as request from 'supertest'; +import { NotificationAppModule } from './../src/notification-app.module'; + +describe('NotificationAppController (e2e)', () => { + let app: INestApplication; + + beforeEach(async () => { + const moduleFixture: TestingModule = await Test.createTestingModule({ + imports: [NotificationAppModule], + }).compile(); + + app = moduleFixture.createNestApplication(); + await app.init(); + }); + + it('/ (GET)', () => { + return request(app.getHttpServer()) + .get('/') + .expect(200) + .expect('Hello World!'); + }); +}); diff --git a/apps/notification-app/test/jest-e2e.json b/apps/notification-app/test/jest-e2e.json new file mode 100644 index 0000000..e9d912f --- /dev/null +++ b/apps/notification-app/test/jest-e2e.json @@ -0,0 +1,9 @@ +{ + "moduleFileExtensions": ["js", "json", "ts"], + "rootDir": ".", + "testEnvironment": "node", + "testRegex": ".e2e-spec.ts$", + "transform": { + "^.+\\.(t|j)s$": "ts-jest" + } +} diff --git a/apps/notification-app/tsconfig.app.json b/apps/notification-app/tsconfig.app.json new file mode 100644 index 0000000..e0e16b3 --- /dev/null +++ b/apps/notification-app/tsconfig.app.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "declaration": false, + "outDir": "../../dist/apps/notification-app" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] +} diff --git a/nest-cli.json b/nest-cli.json index f9aa683..3cdc43b 100644 --- a/nest-cli.json +++ b/nest-cli.json @@ -1,8 +1,41 @@ { "$schema": "https://json.schemastore.org/nest-cli", "collection": "@nestjs/schematics", - "sourceRoot": "src", + "sourceRoot": "apps/nestjs-be-app/src", "compilerOptions": { - "deleteOutDir": true + "deleteOutDir": true, + "webpack": true, + "tsConfigPath": "apps/nestjs-be-app/tsconfig.app.json" + }, + "monorepo": true, + "root": "apps/nestjs-be-app", + "projects": { + "nestjs-be-app": { + "type": "application", + "root": "apps/nestjs-be-app", + "entryFile": "main", + "sourceRoot": "apps/nestjs-be-app/src", + "compilerOptions": { + "tsConfigPath": "apps/nestjs-be-app/tsconfig.app.json" + } + }, + "notification-app": { + "type": "application", + "root": "apps/notification-app", + "entryFile": "main", + "sourceRoot": "apps/notification-app/src", + "compilerOptions": { + "tsConfigPath": "apps/notification-app/tsconfig.app.json" + } + }, + "chat-app": { + "type": "application", + "root": "apps/chat-app", + "entryFile": "main", + "sourceRoot": "apps/chat-app/src", + "compilerOptions": { + "tsConfigPath": "apps/chat-app/tsconfig.app.json" + } + } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 2bdd05a..a890a61 100644 --- a/package.json +++ b/package.json @@ -7,11 +7,11 @@ "license": "UNLICENSED", "scripts": { "build": "nest build", - "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", + "format": "prettier --write \"apps/**/*.ts\" \"libs/**/*.ts\"", "start": "NODE_ENV=development nest start", "start:dev": "NODE_ENV=local nest start --watch", "start:debug": "nest start --debug --watch", - "start:prod": "node dist/main", + "start:prod": "node dist/apps/nestjs-be-app/main", "migrate:generate": "npx sequelize-cli migration:generate --name test", "migrate": "NODE_ENV=local npx sequelize-cli db:migrate", "resource:generate": "nest g resource", @@ -24,7 +24,7 @@ "test:watch": "jest --watch", "test:cov": "jest --coverage", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", - "test:e2e": "jest --config ./test/jest-e2e.json" + "test:e2e": "jest --config ./apps/nestjs-be-app/test/jest-e2e.json" }, "dependencies": { "@fastify/csrf-protection": "^6.1.0", @@ -88,7 +88,7 @@ "json", "ts" ], - "rootDir": "src", + "rootDir": ".", "testRegex": ".*\\.spec\\.ts$", "transform": { "^.+\\.(t|j)s$": "ts-jest" @@ -96,7 +96,10 @@ "collectCoverageFrom": [ "**/*.(t|j)s" ], - "coverageDirectory": "../coverage", - "testEnvironment": "node" + "coverageDirectory": "./coverage", + "testEnvironment": "node", + "roots": [ + "/apps/" + ] } -} +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index adb614c..f4f03e2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,6 +16,7 @@ "noImplicitAny": false, "strictBindCallApply": false, "forceConsistentCasingInFileNames": false, - "noFallthroughCasesInSwitch": false + "noFallthroughCasesInSwitch": false, + "paths": {} } -} +} \ No newline at end of file