Skip to content

Commit

Permalink
removed monorepo and added swc
Browse files Browse the repository at this point in the history
  • Loading branch information
henriqueweiand committed Nov 1, 2023
1 parent bb3ff80 commit 1e7a9fb
Show file tree
Hide file tree
Showing 21 changed files with 6,810 additions and 39 deletions.
17 changes: 17 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"sourceMaps": true,
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true,
"dynamicImport": true
},
"transform": {
"legacyDecorator": true,
"decoratorMetadata": true
},
"baseUrl": "./"
},
"minify": false
}
4 changes: 2 additions & 2 deletions jest-e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"^.+\\.(t|j)s$": "ts-jest"
},
"moduleNameMapper": {
"@app/common/(.*)": "<rootDir>/libs/common/src/$1",
"@app/common": "<rootDir>/libs/common/src"
"@app/common/(.*)": "<rootDir>/src/modules/common/$1",
"@app/common": "<rootDir>/src/modules/common"
},
"globalSetup": "./test/setup.ts",
"globalTeardown": "./test/teardown.ts",
Expand Down
16 changes: 0 additions & 16 deletions libs/common/tsconfig.lib.json

This file was deleted.

13 changes: 1 addition & 12 deletions nest-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true,
"webpack": true
},
"projects": {
"common": {
"type": "library",
"root": "libs/common",
"entryFile": "index",
"sourceRoot": "libs/common/src",
"compilerOptions": {
"tsConfigPath": "libs/common/tsconfig.lib.json"
}
}
"builder": "swc"
}
}
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@rocketseat/eslint-config": "^2.1.0",
"@swc/cli": "0.1.62",
"@swc/core": "1.3.95",
"@swc/jest": "0.2.29",
"@types/express": "^4.17.13",
"@types/jest": "29.2.4",
"@types/node": "18.11.18",
Expand Down Expand Up @@ -69,19 +72,20 @@
"rootDir": ".",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
"^.+\\.(t|j)s$": [
"@swc/jest"
]
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "./coverage",
"testEnvironment": "node",
"roots": [
"<rootDir>/src/",
"<rootDir>/libs/"
"<rootDir>/src/"
],
"moduleNameMapper": {
"^@app/common(|/.*)$": "<rootDir>/libs/common/src/$1"
"^@app/common(|/.*)$": "<rootDir>/src/modules/common/$1"
}
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ describe('User (E2E) Get many', () => {
await app.close();
});

beforeEach(() => {
beforeEach(async () => {
UUID = randomUUID();

await prisma.user.deleteMany();
})

test('[GET] /user', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/users/use-case/create-user.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { UserRepository } from '@app/common/database/repository/user.repositoy';
import { UserRepository } from '@app/common';
import { BadRequestException, ConflictException, Injectable } from '@nestjs/common';
import { CreateUserDto } from '../dto/create-user.dto';

Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"noFallthroughCasesInSwitch": false,
"paths": {
"@app/common": [
"libs/common/src"
"src/modules/common"
],
"@app/common/*": [
"libs/common/src/*"
"src/modules/common/*"
]
}
}
Expand Down
Loading

0 comments on commit 1e7a9fb

Please sign in to comment.