From 1944c6fe0c9ac745c5afd127be3f64c09e6ec146 Mon Sep 17 00:00:00 2001 From: zhumeisongsong Date: Thu, 14 Nov 2024 22:55:01 +0900 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20=E2=9C=A8=20initial=20user=20infras?= =?UTF-8?q?tructure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/user/infrastructure/README.md | 7 ++++++ libs/user/infrastructure/eslint.config.js | 3 +++ libs/user/infrastructure/jest.config.ts | 10 +++++++++ libs/user/infrastructure/project.json | 9 ++++++++ libs/user/infrastructure/src/index.ts | 1 + .../src/lib/user-infrastructure.spec.ts | 7 ++++++ .../src/lib/user-infrastructure.ts | 3 +++ libs/user/infrastructure/tsconfig.json | 22 +++++++++++++++++++ libs/user/infrastructure/tsconfig.lib.json | 11 ++++++++++ libs/user/infrastructure/tsconfig.spec.json | 14 ++++++++++++ tsconfig.base.json | 1 + 11 files changed, 88 insertions(+) create mode 100644 libs/user/infrastructure/README.md create mode 100644 libs/user/infrastructure/eslint.config.js create mode 100644 libs/user/infrastructure/jest.config.ts create mode 100644 libs/user/infrastructure/project.json create mode 100644 libs/user/infrastructure/src/index.ts create mode 100644 libs/user/infrastructure/src/lib/user-infrastructure.spec.ts create mode 100644 libs/user/infrastructure/src/lib/user-infrastructure.ts create mode 100644 libs/user/infrastructure/tsconfig.json create mode 100644 libs/user/infrastructure/tsconfig.lib.json create mode 100644 libs/user/infrastructure/tsconfig.spec.json diff --git a/libs/user/infrastructure/README.md b/libs/user/infrastructure/README.md new file mode 100644 index 0000000..dae9137 --- /dev/null +++ b/libs/user/infrastructure/README.md @@ -0,0 +1,7 @@ +# user-infrastructure + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test user-infrastructure` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/user/infrastructure/eslint.config.js b/libs/user/infrastructure/eslint.config.js new file mode 100644 index 0000000..07e518f --- /dev/null +++ b/libs/user/infrastructure/eslint.config.js @@ -0,0 +1,3 @@ +const baseConfig = require('../../../eslint.config.js'); + +module.exports = [...baseConfig]; diff --git a/libs/user/infrastructure/jest.config.ts b/libs/user/infrastructure/jest.config.ts new file mode 100644 index 0000000..882377d --- /dev/null +++ b/libs/user/infrastructure/jest.config.ts @@ -0,0 +1,10 @@ +export default { + displayName: 'user-infrastructure', + preset: '../../../jest.preset.js', + testEnvironment: 'node', + transform: { + '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../../coverage/libs/user/infrastructure', +}; diff --git a/libs/user/infrastructure/project.json b/libs/user/infrastructure/project.json new file mode 100644 index 0000000..095bc55 --- /dev/null +++ b/libs/user/infrastructure/project.json @@ -0,0 +1,9 @@ +{ + "name": "user-infrastructure", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/user/infrastructure/src", + "projectType": "library", + "tags": [], + "// targets": "to see all targets run: nx show project user-infrastructure --web", + "targets": {} +} diff --git a/libs/user/infrastructure/src/index.ts b/libs/user/infrastructure/src/index.ts new file mode 100644 index 0000000..d8cfa0d --- /dev/null +++ b/libs/user/infrastructure/src/index.ts @@ -0,0 +1 @@ +export * from './lib/user-infrastructure'; diff --git a/libs/user/infrastructure/src/lib/user-infrastructure.spec.ts b/libs/user/infrastructure/src/lib/user-infrastructure.spec.ts new file mode 100644 index 0000000..0b1b110 --- /dev/null +++ b/libs/user/infrastructure/src/lib/user-infrastructure.spec.ts @@ -0,0 +1,7 @@ +import { userInfrastructure } from './user-infrastructure'; + +describe('userInfrastructure', () => { + it('should work', () => { + expect(userInfrastructure()).toEqual('user-infrastructure'); + }); +}); diff --git a/libs/user/infrastructure/src/lib/user-infrastructure.ts b/libs/user/infrastructure/src/lib/user-infrastructure.ts new file mode 100644 index 0000000..0933d40 --- /dev/null +++ b/libs/user/infrastructure/src/lib/user-infrastructure.ts @@ -0,0 +1,3 @@ +export function userInfrastructure(): string { + return 'user-infrastructure'; +} diff --git a/libs/user/infrastructure/tsconfig.json b/libs/user/infrastructure/tsconfig.json new file mode 100644 index 0000000..0dc79ca --- /dev/null +++ b/libs/user/infrastructure/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "noPropertyAccessFromIndexSignature": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/user/infrastructure/tsconfig.lib.json b/libs/user/infrastructure/tsconfig.lib.json new file mode 100644 index 0000000..e583571 --- /dev/null +++ b/libs/user/infrastructure/tsconfig.lib.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "../../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], + "include": ["src/**/*.ts"] +} diff --git a/libs/user/infrastructure/tsconfig.spec.json b/libs/user/infrastructure/tsconfig.spec.json new file mode 100644 index 0000000..69a251f --- /dev/null +++ b/libs/user/infrastructure/tsconfig.spec.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": [ + "jest.config.ts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.d.ts" + ] +} diff --git a/tsconfig.base.json b/tsconfig.base.json index 4acfc6a..c99ac5e 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -18,6 +18,7 @@ "@libs/config": ["libs/config/src/index.ts"], "@prompt/domain": ["libs/prompt/domain/src/index.ts"], "@user/domain": ["libs/user/domain/src/index.ts"], + "@user/infrastructure": ["libs/user/infrastructure/src/index.ts"], "@user/usecase": ["libs/user/usecase/src/index.ts"] } }, From f6958d8e67d4ec1279b19d615d1bc73779da1318 Mon Sep 17 00:00:00 2001 From: zhumeisongsong Date: Fri, 15 Nov 2024 15:06:39 +0900 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20=E2=9C=A8=20add=20lib=20of=20@user/?= =?UTF-8?q?infrastructure-mongoose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/user/infrastructure/README.md | 7 - libs/user/infrastructure/eslint.config.js | 3 - libs/user/infrastructure/mongoose/README.md | 7 + .../infrastructure/mongoose/eslint.config.js | 3 + .../{ => mongoose}/jest.config.ts | 6 +- .../user/infrastructure/mongoose/project.json | 9 + .../user/infrastructure/mongoose/src/index.ts | 1 + .../src/lib/mongoose-user.repository.spec.ts | 47 +++++ .../src/lib/mongoose-user.repository.ts | 16 ++ .../mongoose/src/lib/user.schema.spec.ts | 36 ++++ .../mongoose/src/lib/user.schema.ts | 10 + .../{ => mongoose}/tsconfig.json | 2 +- .../{ => mongoose}/tsconfig.lib.json | 2 +- .../{ => mongoose}/tsconfig.spec.json | 2 +- libs/user/infrastructure/project.json | 9 - libs/user/infrastructure/src/index.ts | 1 - .../src/lib/user-infrastructure.spec.ts | 7 - .../src/lib/user-infrastructure.ts | 3 - package.json | 2 + pnpm-lock.yaml | 174 ++++++++++++++++++ tsconfig.base.json | 4 +- 21 files changed, 314 insertions(+), 37 deletions(-) delete mode 100644 libs/user/infrastructure/README.md delete mode 100644 libs/user/infrastructure/eslint.config.js create mode 100644 libs/user/infrastructure/mongoose/README.md create mode 100644 libs/user/infrastructure/mongoose/eslint.config.js rename libs/user/infrastructure/{ => mongoose}/jest.config.ts (53%) create mode 100644 libs/user/infrastructure/mongoose/project.json create mode 100644 libs/user/infrastructure/mongoose/src/index.ts create mode 100644 libs/user/infrastructure/mongoose/src/lib/mongoose-user.repository.spec.ts create mode 100644 libs/user/infrastructure/mongoose/src/lib/mongoose-user.repository.ts create mode 100644 libs/user/infrastructure/mongoose/src/lib/user.schema.spec.ts create mode 100644 libs/user/infrastructure/mongoose/src/lib/user.schema.ts rename libs/user/infrastructure/{ => mongoose}/tsconfig.json (90%) rename libs/user/infrastructure/{ => mongoose}/tsconfig.lib.json (85%) rename libs/user/infrastructure/{ => mongoose}/tsconfig.spec.json (84%) delete mode 100644 libs/user/infrastructure/project.json delete mode 100644 libs/user/infrastructure/src/index.ts delete mode 100644 libs/user/infrastructure/src/lib/user-infrastructure.spec.ts delete mode 100644 libs/user/infrastructure/src/lib/user-infrastructure.ts diff --git a/libs/user/infrastructure/README.md b/libs/user/infrastructure/README.md deleted file mode 100644 index dae9137..0000000 --- a/libs/user/infrastructure/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# user-infrastructure - -This library was generated with [Nx](https://nx.dev). - -## Running unit tests - -Run `nx test user-infrastructure` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/user/infrastructure/eslint.config.js b/libs/user/infrastructure/eslint.config.js deleted file mode 100644 index 07e518f..0000000 --- a/libs/user/infrastructure/eslint.config.js +++ /dev/null @@ -1,3 +0,0 @@ -const baseConfig = require('../../../eslint.config.js'); - -module.exports = [...baseConfig]; diff --git a/libs/user/infrastructure/mongoose/README.md b/libs/user/infrastructure/mongoose/README.md new file mode 100644 index 0000000..4b45293 --- /dev/null +++ b/libs/user/infrastructure/mongoose/README.md @@ -0,0 +1,7 @@ +# user-infrastructure-mongoose + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test user-infrastructure-mongoose` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/user/infrastructure/mongoose/eslint.config.js b/libs/user/infrastructure/mongoose/eslint.config.js new file mode 100644 index 0000000..cdd3cba --- /dev/null +++ b/libs/user/infrastructure/mongoose/eslint.config.js @@ -0,0 +1,3 @@ +const baseConfig = require('../../../../eslint.config.js'); + +module.exports = [...baseConfig]; diff --git a/libs/user/infrastructure/jest.config.ts b/libs/user/infrastructure/mongoose/jest.config.ts similarity index 53% rename from libs/user/infrastructure/jest.config.ts rename to libs/user/infrastructure/mongoose/jest.config.ts index 882377d..7568b33 100644 --- a/libs/user/infrastructure/jest.config.ts +++ b/libs/user/infrastructure/mongoose/jest.config.ts @@ -1,10 +1,10 @@ export default { - displayName: 'user-infrastructure', - preset: '../../../jest.preset.js', + displayName: 'user-infrastructure-mongoose', + preset: '../../../../jest.preset.js', testEnvironment: 'node', transform: { '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], }, moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../../coverage/libs/user/infrastructure', + coverageDirectory: '../../../../coverage/libs/user/infrastructure/mongoose', }; diff --git a/libs/user/infrastructure/mongoose/project.json b/libs/user/infrastructure/mongoose/project.json new file mode 100644 index 0000000..afadef9 --- /dev/null +++ b/libs/user/infrastructure/mongoose/project.json @@ -0,0 +1,9 @@ +{ + "name": "user-infrastructure-mongoose", + "$schema": "../../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/user/infrastructure/mongoose/src", + "projectType": "library", + "tags": [], + "// targets": "to see all targets run: nx show project user-infrastructure-mongoose --web", + "targets": {} +} diff --git a/libs/user/infrastructure/mongoose/src/index.ts b/libs/user/infrastructure/mongoose/src/index.ts new file mode 100644 index 0000000..a432c8c --- /dev/null +++ b/libs/user/infrastructure/mongoose/src/index.ts @@ -0,0 +1 @@ +export * from './lib/user-infrastructure-mongoose'; diff --git a/libs/user/infrastructure/mongoose/src/lib/mongoose-user.repository.spec.ts b/libs/user/infrastructure/mongoose/src/lib/mongoose-user.repository.spec.ts new file mode 100644 index 0000000..20a9466 --- /dev/null +++ b/libs/user/infrastructure/mongoose/src/lib/mongoose-user.repository.spec.ts @@ -0,0 +1,47 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { getModelToken } from '@nestjs/mongoose'; +import { Model } from 'mongoose'; +import { MongooseUserRepository } from './mongoose-user.repository'; +import { UserDocument } from './user.schema'; +import { User } from '@user/domain'; + +describe('MongooseUserRepository', () => { + let repository: MongooseUserRepository; + let userModel: Model; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [ + MongooseUserRepository, + { + provide: getModelToken(UserDocument.name), + useValue: { + findById: jest.fn(), + }, + }, + ], + }).compile(); + + repository = module.get(MongooseUserRepository); + userModel = module.get>(getModelToken(UserDocument.name)); + }); + + it('should return a user when found', async () => { + const userDoc = { id: '1', name: 'John Doe' }; + jest.spyOn(userModel, 'findById').mockReturnValue({ + exec: jest.fn().mockResolvedValue(userDoc), + } as any); + + const user = await repository.findById('1'); + expect(user).toEqual(new User('1', 'John Doe')); + }); + + it('should return null when user is not found', async () => { + jest.spyOn(userModel, 'findById').mockReturnValue({ + exec: jest.fn().mockResolvedValue(null), + } as any); + + const user = await repository.findById('1'); + expect(user).toBeNull(); + }); +}); \ No newline at end of file diff --git a/libs/user/infrastructure/mongoose/src/lib/mongoose-user.repository.ts b/libs/user/infrastructure/mongoose/src/lib/mongoose-user.repository.ts new file mode 100644 index 0000000..61af61d --- /dev/null +++ b/libs/user/infrastructure/mongoose/src/lib/mongoose-user.repository.ts @@ -0,0 +1,16 @@ +import { InjectModel } from '@nestjs/mongoose'; +import { User, UserRepository } from '@user/domain'; +import { Model } from 'mongoose'; + +import { UserDocument } from './user.schema'; + +export class MongooseUserRepository implements UserRepository { + constructor( + @InjectModel(UserDocument.name) private userModel: Model, + ) {} + + async findById(id: string): Promise { + const userDoc = await this.userModel.findById(id).exec(); + return userDoc ? new User(userDoc.id, userDoc.name) : null; + } +} diff --git a/libs/user/infrastructure/mongoose/src/lib/user.schema.spec.ts b/libs/user/infrastructure/mongoose/src/lib/user.schema.spec.ts new file mode 100644 index 0000000..848c5e9 --- /dev/null +++ b/libs/user/infrastructure/mongoose/src/lib/user.schema.spec.ts @@ -0,0 +1,36 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { getModelToken } from '@nestjs/mongoose'; +import { Model } from 'mongoose'; +import { UserDocument } from './user.schema'; + +describe('UserDocument', () => { + let userModel: Model; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [ + { + provide: getModelToken(UserDocument.name), + useValue: Model, + }, + ], + }).compile(); + + userModel = module.get>(getModelToken(UserDocument.name)); + }); + + it('should be defined', () => { + expect(userModel).toBeDefined(); + }); + + // it('should require name field', () => { + // const user = new userModel(); + // const error = user.validateSync(); + // expect(error.errors['name']).toBeDefined(); + // }); + + // it('should create a user with a name', () => { + // const user = new userModel({ name: 'John Doe' }); + // expect(user.name).toBe('John Doe'); + // }); +}); \ No newline at end of file diff --git a/libs/user/infrastructure/mongoose/src/lib/user.schema.ts b/libs/user/infrastructure/mongoose/src/lib/user.schema.ts new file mode 100644 index 0000000..ff6527f --- /dev/null +++ b/libs/user/infrastructure/mongoose/src/lib/user.schema.ts @@ -0,0 +1,10 @@ +import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; +import { Document } from 'mongoose'; + +@Schema() +export class UserDocument extends Document { + @Prop({ required: true }) + name!: string; +} + +export const UserSchema = SchemaFactory.createForClass(UserDocument); \ No newline at end of file diff --git a/libs/user/infrastructure/tsconfig.json b/libs/user/infrastructure/mongoose/tsconfig.json similarity index 90% rename from libs/user/infrastructure/tsconfig.json rename to libs/user/infrastructure/mongoose/tsconfig.json index 0dc79ca..07e0ec6 100644 --- a/libs/user/infrastructure/tsconfig.json +++ b/libs/user/infrastructure/mongoose/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { "module": "commonjs", "forceConsistentCasingInFileNames": true, diff --git a/libs/user/infrastructure/tsconfig.lib.json b/libs/user/infrastructure/mongoose/tsconfig.lib.json similarity index 85% rename from libs/user/infrastructure/tsconfig.lib.json rename to libs/user/infrastructure/mongoose/tsconfig.lib.json index e583571..28369ef 100644 --- a/libs/user/infrastructure/tsconfig.lib.json +++ b/libs/user/infrastructure/mongoose/tsconfig.lib.json @@ -2,7 +2,7 @@ "extends": "./tsconfig.json", "compilerOptions": { "module": "commonjs", - "outDir": "../../../dist/out-tsc", + "outDir": "../../../../dist/out-tsc", "declaration": true, "types": ["node"] }, diff --git a/libs/user/infrastructure/tsconfig.spec.json b/libs/user/infrastructure/mongoose/tsconfig.spec.json similarity index 84% rename from libs/user/infrastructure/tsconfig.spec.json rename to libs/user/infrastructure/mongoose/tsconfig.spec.json index 69a251f..6668655 100644 --- a/libs/user/infrastructure/tsconfig.spec.json +++ b/libs/user/infrastructure/mongoose/tsconfig.spec.json @@ -1,7 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../../dist/out-tsc", + "outDir": "../../../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node"] }, diff --git a/libs/user/infrastructure/project.json b/libs/user/infrastructure/project.json deleted file mode 100644 index 095bc55..0000000 --- a/libs/user/infrastructure/project.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "user-infrastructure", - "$schema": "../../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "libs/user/infrastructure/src", - "projectType": "library", - "tags": [], - "// targets": "to see all targets run: nx show project user-infrastructure --web", - "targets": {} -} diff --git a/libs/user/infrastructure/src/index.ts b/libs/user/infrastructure/src/index.ts deleted file mode 100644 index d8cfa0d..0000000 --- a/libs/user/infrastructure/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './lib/user-infrastructure'; diff --git a/libs/user/infrastructure/src/lib/user-infrastructure.spec.ts b/libs/user/infrastructure/src/lib/user-infrastructure.spec.ts deleted file mode 100644 index 0b1b110..0000000 --- a/libs/user/infrastructure/src/lib/user-infrastructure.spec.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { userInfrastructure } from './user-infrastructure'; - -describe('userInfrastructure', () => { - it('should work', () => { - expect(userInfrastructure()).toEqual('user-infrastructure'); - }); -}); diff --git a/libs/user/infrastructure/src/lib/user-infrastructure.ts b/libs/user/infrastructure/src/lib/user-infrastructure.ts deleted file mode 100644 index 0933d40..0000000 --- a/libs/user/infrastructure/src/lib/user-infrastructure.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function userInfrastructure(): string { - return 'user-infrastructure'; -} diff --git a/package.json b/package.json index aead434..21d9cf9 100644 --- a/package.json +++ b/package.json @@ -20,11 +20,13 @@ "@nestjs/config": "^3.3.0", "@nestjs/core": "^10.4.7", "@nestjs/graphql": "^12.2.1", + "@nestjs/mongoose": "^10.1.0", "@nestjs/platform-express": "^10.4.7", "axios": "^1.7.7", "graphql": "^16.9.0", "graphql-tools": "^9.0.2", "inlineTrace": "link:@apollo/server/plugin/inlineTrace", + "mongoose": "^8.8.1", "reflect-metadata": "^0.2.0", "rxjs": "^7.8.1", "zod": "^3.23.8" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 54934f2..1c1eec5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,6 +32,9 @@ importers: '@nestjs/graphql': specifier: ^12.2.1 version: 12.2.1(@apollo/subgraph@2.9.3(graphql@16.9.0))(@nestjs/common@10.4.7(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.7)(graphql@16.9.0)(reflect-metadata@0.2.2) + '@nestjs/mongoose': + specifier: ^10.1.0 + version: 10.1.0(@nestjs/common@10.4.7(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.7)(mongoose@8.8.1(socks@2.8.3))(rxjs@7.8.1) '@nestjs/platform-express': specifier: ^10.4.7 version: 10.4.7(@nestjs/common@10.4.7(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.7) @@ -47,6 +50,9 @@ importers: inlineTrace: specifier: link:@apollo/server/plugin/inlineTrace version: link:@apollo/server/plugin/inlineTrace + mongoose: + specifier: ^8.8.1 + version: 8.8.1(socks@2.8.3) reflect-metadata: specifier: ^0.2.0 version: 0.2.2 @@ -1250,6 +1256,9 @@ packages: '@module-federation/webpack-bundler-runtime@0.6.16': resolution: {integrity: sha512-Tpi251DApEaQ62KCaJCh1RU1SZTUcVh8lx2zotn/YOMZdw83IzYu3PYYA1V0Eg5jVe6I2GmGH52pJPCtwbgjqA==} + '@mongodb-js/saslprep@1.1.9': + resolution: {integrity: sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw==} + '@napi-rs/wasm-runtime@0.2.4': resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} @@ -1342,6 +1351,14 @@ packages: class-validator: optional: true + '@nestjs/mongoose@10.1.0': + resolution: {integrity: sha512-1ExAnZUfh2QffEaGjqYGgVPy/sYBQCVLCLqVgkcClKx/BCd0QNgND8MB70lwyobp3nm/+nbGQqBpu9F3/hgOCw==} + peerDependencies: + '@nestjs/common': ^8.0.0 || ^9.0.0 || ^10.0.0 + '@nestjs/core': ^8.0.0 || ^9.0.0 || ^10.0.0 + mongoose: ^6.0.2 || ^7.0.0 || ^8.0.0 + rxjs: ^7.0.0 + '@nestjs/platform-express@10.4.7': resolution: {integrity: sha512-q6XDOxZPTZ9cxALcVuKUlRBk+cVEv6dW2S8p2yVre22kpEQxq53/OI8EseDvzObGb6hepZ8+yBY04qoYqSlXNQ==} peerDependencies: @@ -1921,6 +1938,12 @@ packages: '@types/uuid@9.0.8': resolution: {integrity: sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==} + '@types/webidl-conversions@7.0.3': + resolution: {integrity: sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==} + + '@types/whatwg-url@11.0.5': + resolution: {integrity: sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==} + '@types/ws@8.5.13': resolution: {integrity: sha512-osM/gWBTPKgHV8XkTunnegTRIsvF6owmf5w+JtAfOw472dptdm0dlGv4xCt6GwQRcC2XVOvvRE/0bAoQcL2QkA==} @@ -2413,6 +2436,10 @@ packages: bser@2.1.1: resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} + bson@6.9.0: + resolution: {integrity: sha512-X9hJeyeM0//Fus+0pc5dSUMhhrrmWwQUtdavaQeF3Ta6m69matZkGWV/MrBcnwUeLC8W9kwwc2hfkZgUuCX3Ig==} + engines: {node: '>=16.20.1'} + btoa@1.2.1: resolution: {integrity: sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==} engines: {node: '>= 0.4.0'} @@ -4019,6 +4046,10 @@ packages: jsonfile@6.1.0: resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} + kareem@2.6.3: + resolution: {integrity: sha512-C3iHfuGUXK2u8/ipq9LfjFfXFxAZMQJJq7vLS45r3D9Y2xQ/m4S8zaR4zMLFWh9AsNPXmcFfUDhTEO8UIC/V6Q==} + engines: {node: '>=12.0.0'} + keygrip@1.1.0: resolution: {integrity: sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==} engines: {node: '>= 0.6'} @@ -4215,6 +4246,9 @@ packages: resolution: {integrity: sha512-JUeY0F/fQZgIod31Ja1eJgiSxLn7BfQlCnqhwXFBzFHEw63OdLK7VJUJ7bnzNsWgCyoUP5tEp1VRY8rDaYzqOA==} engines: {node: '>= 4.0.0'} + memory-pager@1.5.0: + resolution: {integrity: sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==} + merge-descriptors@1.0.3: resolution: {integrity: sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==} @@ -4326,6 +4360,48 @@ packages: engines: {node: '>=10'} hasBin: true + mongodb-connection-string-url@3.0.1: + resolution: {integrity: sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==} + + mongodb@6.10.0: + resolution: {integrity: sha512-gP9vduuYWb9ZkDM546M+MP2qKVk5ZG2wPF63OvSRuUbqCR+11ZCAE1mOfllhlAG0wcoJY5yDL/rV3OmYEwXIzg==} + engines: {node: '>=16.20.1'} + peerDependencies: + '@aws-sdk/credential-providers': ^3.188.0 + '@mongodb-js/zstd': ^1.1.0 + gcp-metadata: ^5.2.0 + kerberos: ^2.0.1 + mongodb-client-encryption: '>=6.0.0 <7' + snappy: ^7.2.2 + socks: ^2.7.1 + peerDependenciesMeta: + '@aws-sdk/credential-providers': + optional: true + '@mongodb-js/zstd': + optional: true + gcp-metadata: + optional: true + kerberos: + optional: true + mongodb-client-encryption: + optional: true + snappy: + optional: true + socks: + optional: true + + mongoose@8.8.1: + resolution: {integrity: sha512-l7DgeY1szT98+EKU8GYnga5WnyatAu+kOQ2VlVX1Mxif6A0Umt0YkSiksCiyGxzx8SPhGe9a53ND1GD4yVDrPA==} + engines: {node: '>=16.20.1'} + + mpath@0.9.0: + resolution: {integrity: sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==} + engines: {node: '>=4.0.0'} + + mquery@5.0.0: + resolution: {integrity: sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==} + engines: {node: '>=14.0.0'} + ms@2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} @@ -5192,6 +5268,9 @@ packages: resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} engines: {node: '>= 0.4'} + sift@17.1.3: + resolution: {integrity: sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==} + signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} @@ -5255,6 +5334,9 @@ packages: resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} engines: {node: '>= 8'} + sparse-bitfield@3.0.3: + resolution: {integrity: sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==} + spdy-transport@3.0.0: resolution: {integrity: sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==} @@ -5460,6 +5542,10 @@ packages: tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + tr46@4.1.1: + resolution: {integrity: sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==} + engines: {node: '>=14'} + tree-dump@1.0.2: resolution: {integrity: sha512-dpev9ABuLWdEubk+cIaI9cHwRNNDjkBBLXTwI4UCUFdQ5xXKqNXoK4FEciw/vxf+NQ7Cb7sGUyeUtORvHIdRXQ==} engines: {node: '>=10.0'} @@ -5718,6 +5804,10 @@ packages: webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + webidl-conversions@7.0.0: + resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} + engines: {node: '>=12'} + webpack-cli@5.1.4: resolution: {integrity: sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==} engines: {node: '>=14.15.0'} @@ -5805,6 +5895,10 @@ packages: resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} engines: {node: '>=12'} + whatwg-url@13.0.0: + resolution: {integrity: sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==} + engines: {node: '>=16'} + whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} @@ -7449,6 +7543,10 @@ snapshots: '@module-federation/runtime': 0.6.16 '@module-federation/sdk': 0.6.16 + '@mongodb-js/saslprep@1.1.9': + dependencies: + sparse-bitfield: 3.0.3 + '@napi-rs/wasm-runtime@0.2.4': dependencies: '@emnapi/core': 1.3.1 @@ -7533,6 +7631,13 @@ snapshots: '@nestjs/common': 10.4.7(reflect-metadata@0.2.2)(rxjs@7.8.1) reflect-metadata: 0.2.2 + '@nestjs/mongoose@10.1.0(@nestjs/common@10.4.7(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.7)(mongoose@8.8.1(socks@2.8.3))(rxjs@7.8.1)': + dependencies: + '@nestjs/common': 10.4.7(reflect-metadata@0.2.2)(rxjs@7.8.1) + '@nestjs/core': 10.4.7(@nestjs/common@10.4.7(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.7)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) + mongoose: 8.8.1(socks@2.8.3) + rxjs: 7.8.1 + '@nestjs/platform-express@10.4.7(@nestjs/common@10.4.7(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.7)': dependencies: '@nestjs/common': 10.4.7(reflect-metadata@0.2.2)(rxjs@7.8.1) @@ -8350,6 +8455,12 @@ snapshots: '@types/uuid@9.0.8': {} + '@types/webidl-conversions@7.0.3': {} + + '@types/whatwg-url@11.0.5': + dependencies: + '@types/webidl-conversions': 7.0.3 + '@types/ws@8.5.13': dependencies: '@types/node': 22.9.0 @@ -8960,6 +9071,8 @@ snapshots: dependencies: node-int64: 0.4.0 + bson@6.9.0: {} + btoa@1.2.1: {} buffer-from@1.1.2: {} @@ -10806,6 +10919,8 @@ snapshots: optionalDependencies: graceful-fs: 4.2.11 + kareem@2.6.3: {} + keygrip@1.1.0: dependencies: tsscmp: 1.0.6 @@ -11031,6 +11146,8 @@ snapshots: tree-dump: 1.0.2(tslib@2.8.1) tslib: 2.8.1 + memory-pager@1.5.0: {} + merge-descriptors@1.0.3: {} merge-stream@2.0.0: {} @@ -11124,6 +11241,46 @@ snapshots: mkdirp@1.0.4: {} + mongodb-connection-string-url@3.0.1: + dependencies: + '@types/whatwg-url': 11.0.5 + whatwg-url: 13.0.0 + + mongodb@6.10.0(socks@2.8.3): + dependencies: + '@mongodb-js/saslprep': 1.1.9 + bson: 6.9.0 + mongodb-connection-string-url: 3.0.1 + optionalDependencies: + socks: 2.8.3 + + mongoose@8.8.1(socks@2.8.3): + dependencies: + bson: 6.9.0 + kareem: 2.6.3 + mongodb: 6.10.0(socks@2.8.3) + mpath: 0.9.0 + mquery: 5.0.0 + ms: 2.1.3 + sift: 17.1.3 + transitivePeerDependencies: + - '@aws-sdk/credential-providers' + - '@mongodb-js/zstd' + - gcp-metadata + - kerberos + - mongodb-client-encryption + - snappy + - socks + - supports-color + + mpath@0.9.0: {} + + mquery@5.0.0: + dependencies: + debug: 4.3.7 + transitivePeerDependencies: + - supports-color + ms@2.0.0: {} ms@2.1.3: {} @@ -12018,6 +12175,8 @@ snapshots: get-intrinsic: 1.2.4 object-inspect: 1.13.2 + sift@17.1.3: {} + signal-exit@3.0.7: {} signal-exit@4.1.0: {} @@ -12078,6 +12237,10 @@ snapshots: source-map@0.7.4: {} + sparse-bitfield@3.0.3: + dependencies: + memory-pager: 1.5.0 + spdy-transport@3.0.0: dependencies: debug: 4.3.7 @@ -12297,6 +12460,10 @@ snapshots: tr46@0.0.3: {} + tr46@4.1.1: + dependencies: + punycode: 2.3.1 + tree-dump@1.0.2(tslib@2.8.1): dependencies: tslib: 2.8.1 @@ -12545,6 +12712,8 @@ snapshots: webidl-conversions@3.0.1: {} + webidl-conversions@7.0.0: {} + webpack-cli@5.1.4(webpack@5.96.1): dependencies: '@discoveryjs/json-ext': 0.5.7 @@ -12673,6 +12842,11 @@ snapshots: whatwg-mimetype@3.0.0: {} + whatwg-url@13.0.0: + dependencies: + tr46: 4.1.1 + webidl-conversions: 7.0.0 + whatwg-url@5.0.0: dependencies: tr46: 0.0.3 diff --git a/tsconfig.base.json b/tsconfig.base.json index c99ac5e..19cc012 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -18,7 +18,9 @@ "@libs/config": ["libs/config/src/index.ts"], "@prompt/domain": ["libs/prompt/domain/src/index.ts"], "@user/domain": ["libs/user/domain/src/index.ts"], - "@user/infrastructure": ["libs/user/infrastructure/src/index.ts"], + "@user/infrastructure-mongoose": [ + "libs/user/infrastructure/mongoose/src/index.ts" + ], "@user/usecase": ["libs/user/usecase/src/index.ts"] } }, From 48f0beb4b8d2d1bc8a2e2390e3fd9e42e1a09880 Mon Sep 17 00:00:00 2001 From: zhumeisongsong Date: Fri, 15 Nov 2024 15:12:28 +0900 Subject: [PATCH 3/6] =?UTF-8?q?docs:=20=F0=9F=93=9D=20mongoose=20of=20infr?= =?UTF-8?q?astructure=20layer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5a66768..6a84fd6 100644 --- a/README.md +++ b/README.md @@ -54,11 +54,12 @@ You can use `npx nx list` to get a list of installed plugins. Then, run `npx nx ## Architecture -| Layer | Description | -| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| usecase | Define business use cases and encapsulate business logic. | -| entity(domain) | Define core business entities and business rules.
Maintain entity independence from database and framework. | -| repository(domain) | Interfaces (or abstract classes), which define methods for manipulating data without concern for specific database implementations.
By defining this interface, we can decouple database access: the specific details of data access will be done by implementation classes, such as specific implementations using tools like Mongoose, TypeORM, Prisma, and so on. | +| Layer | Description | +| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| usecase(application) | Define business use cases and encapsulate business logic. | +| entity(domain) | Define core business entities and business rules.
Maintain entity independence from database and framework. | +| repository(domain) | Interfaces (or abstract classes), which define methods for manipulating data without concern for specific database implementations.
By defining this interface, we can decouple database access: the specific details of data access will be done by implementation classes, such as specific implementations using tools like Mongoose, TypeORM, Prisma, and so on. | +| mongoose(infrastructure) | Mongoose Schema definition.
Implement the xxxRepository interface | ## Useful links From 75fdd65f5f20746a1bba84f214d6804d636381af Mon Sep 17 00:00:00 2001 From: zhumeisongsong Date: Fri, 15 Nov 2024 15:43:33 +0900 Subject: [PATCH 4/6] =?UTF-8?q?docs:=20=F0=9F=93=9D=20Update=20mongoose(in?= =?UTF-8?q?frastructure)=20description?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6a84fd6..8946f28 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ You can use `npx nx list` to get a list of installed plugins. Then, run `npx nx | usecase(application) | Define business use cases and encapsulate business logic. | | entity(domain) | Define core business entities and business rules.
Maintain entity independence from database and framework. | | repository(domain) | Interfaces (or abstract classes), which define methods for manipulating data without concern for specific database implementations.
By defining this interface, we can decouple database access: the specific details of data access will be done by implementation classes, such as specific implementations using tools like Mongoose, TypeORM, Prisma, and so on. | -| mongoose(infrastructure) | Mongoose Schema definition.
Implement the xxxRepository interface | +| mongoose(infrastructure) | Implements the repository interfaces defined in the domain layer using Mongoose as the ODM (Object Document Mapper).
Includes Mongoose Schema definitions, database connection management, and concrete implementations of repository interfaces (e.g., MongooseUserRepository). | ## Useful links From 9da264e677fc22cfec45c73f46171a5b8787c132 Mon Sep 17 00:00:00 2001 From: zhumeisongsong Date: Mon, 18 Nov 2024 19:09:19 +0900 Subject: [PATCH 5/6] =?UTF-8?q?feat:=20=E2=9C=A8=20remove=20user-infrastru?= =?UTF-8?q?cture-mongoose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/user/infrastructure/mongoose/README.md | 7 ------ .../infrastructure/mongoose/eslint.config.js | 3 --- .../infrastructure/mongoose/jest.config.ts | 10 --------- .../user/infrastructure/mongoose/project.json | 9 -------- .../user/infrastructure/mongoose/src/index.ts | 1 - .../infrastructure/mongoose/tsconfig.json | 22 ------------------- .../infrastructure/mongoose/tsconfig.lib.json | 11 ---------- .../mongoose/tsconfig.spec.json | 14 ------------ 8 files changed, 77 deletions(-) delete mode 100644 libs/user/infrastructure/mongoose/README.md delete mode 100644 libs/user/infrastructure/mongoose/eslint.config.js delete mode 100644 libs/user/infrastructure/mongoose/jest.config.ts delete mode 100644 libs/user/infrastructure/mongoose/project.json delete mode 100644 libs/user/infrastructure/mongoose/src/index.ts delete mode 100644 libs/user/infrastructure/mongoose/tsconfig.json delete mode 100644 libs/user/infrastructure/mongoose/tsconfig.lib.json delete mode 100644 libs/user/infrastructure/mongoose/tsconfig.spec.json diff --git a/libs/user/infrastructure/mongoose/README.md b/libs/user/infrastructure/mongoose/README.md deleted file mode 100644 index 4b45293..0000000 --- a/libs/user/infrastructure/mongoose/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# user-infrastructure-mongoose - -This library was generated with [Nx](https://nx.dev). - -## Running unit tests - -Run `nx test user-infrastructure-mongoose` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/user/infrastructure/mongoose/eslint.config.js b/libs/user/infrastructure/mongoose/eslint.config.js deleted file mode 100644 index cdd3cba..0000000 --- a/libs/user/infrastructure/mongoose/eslint.config.js +++ /dev/null @@ -1,3 +0,0 @@ -const baseConfig = require('../../../../eslint.config.js'); - -module.exports = [...baseConfig]; diff --git a/libs/user/infrastructure/mongoose/jest.config.ts b/libs/user/infrastructure/mongoose/jest.config.ts deleted file mode 100644 index 7568b33..0000000 --- a/libs/user/infrastructure/mongoose/jest.config.ts +++ /dev/null @@ -1,10 +0,0 @@ -export default { - displayName: 'user-infrastructure-mongoose', - preset: '../../../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../../../coverage/libs/user/infrastructure/mongoose', -}; diff --git a/libs/user/infrastructure/mongoose/project.json b/libs/user/infrastructure/mongoose/project.json deleted file mode 100644 index afadef9..0000000 --- a/libs/user/infrastructure/mongoose/project.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "user-infrastructure-mongoose", - "$schema": "../../../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "libs/user/infrastructure/mongoose/src", - "projectType": "library", - "tags": [], - "// targets": "to see all targets run: nx show project user-infrastructure-mongoose --web", - "targets": {} -} diff --git a/libs/user/infrastructure/mongoose/src/index.ts b/libs/user/infrastructure/mongoose/src/index.ts deleted file mode 100644 index a432c8c..0000000 --- a/libs/user/infrastructure/mongoose/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './lib/user-infrastructure-mongoose'; diff --git a/libs/user/infrastructure/mongoose/tsconfig.json b/libs/user/infrastructure/mongoose/tsconfig.json deleted file mode 100644 index 07e0ec6..0000000 --- a/libs/user/infrastructure/mongoose/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "module": "commonjs", - "forceConsistentCasingInFileNames": true, - "strict": true, - "noImplicitOverride": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "noPropertyAccessFromIndexSignature": true - }, - "files": [], - "include": [], - "references": [ - { - "path": "./tsconfig.lib.json" - }, - { - "path": "./tsconfig.spec.json" - } - ] -} diff --git a/libs/user/infrastructure/mongoose/tsconfig.lib.json b/libs/user/infrastructure/mongoose/tsconfig.lib.json deleted file mode 100644 index 28369ef..0000000 --- a/libs/user/infrastructure/mongoose/tsconfig.lib.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "commonjs", - "outDir": "../../../../dist/out-tsc", - "declaration": true, - "types": ["node"] - }, - "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], - "include": ["src/**/*.ts"] -} diff --git a/libs/user/infrastructure/mongoose/tsconfig.spec.json b/libs/user/infrastructure/mongoose/tsconfig.spec.json deleted file mode 100644 index 6668655..0000000 --- a/libs/user/infrastructure/mongoose/tsconfig.spec.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"] - }, - "include": [ - "jest.config.ts", - "src/**/*.test.ts", - "src/**/*.spec.ts", - "src/**/*.d.ts" - ] -} From d7d0e640442985a71cc7a0da9b8a9dd4a10998e1 Mon Sep 17 00:00:00 2001 From: zhumeisongsong Date: Tue, 19 Nov 2024 15:39:09 +0900 Subject: [PATCH 6/6] =?UTF-8?q?fix:=20=F0=9F=90=9B=20remove=20use=20less?= =?UTF-8?q?=20ts=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tsconfig.base.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/tsconfig.base.json b/tsconfig.base.json index d8ee6b9..ee04d91 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -21,9 +21,6 @@ "libs/shared/infrastructure/mongoose/src/index.ts" ], "@user/domain": ["libs/user/domain/src/index.ts"], - "@user/infrastructure-mongoose": [ - "users/infrastructure/mongoose/src/index.ts" - ], "@users/application": ["libs/users/application/src/index.ts"], "@users/infrastructure-mongoose": [ "libs/users/infrastructure/mongoose/src/index.ts"