Skip to content

Commit

Permalink
refactor: ♻️ User-domain to users-domain
Browse files Browse the repository at this point in the history
  • Loading branch information
zhumeisongsong committed Nov 19, 2024
1 parent d7d0e64 commit 54e38fa
Show file tree
Hide file tree
Showing 22 changed files with 21 additions and 22 deletions.
9 changes: 0 additions & 9 deletions libs/user/domain/project.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GetUserUseCase } from './get-user.use-case';
import { UserRepository } from '@user/domain';
import { UserRepository } from '@users/domain';

describe('GetUserUseCase', () => {
let getUserUseCase: GetUserUseCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { User, UserRepository } from '@user/domain';
import { User, UserRepository } from '@users/domain';

export class GetUserUseCase {
constructor(private readonly userRepository: UserRepository) {}
Expand Down
2 changes: 1 addition & 1 deletion libs/users/application/src/lib/users.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Test, TestingModule } from '@nestjs/testing';
import { User } from '@user/domain';
import { User } from '@users/domain';

import { UsersService } from './users.service';

Expand Down
2 changes: 1 addition & 1 deletion libs/users/application/src/lib/users.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Injectable } from '@nestjs/common';
import { User } from '@user/domain';
import { User } from '@users/domain';

@Injectable()
export class UsersService {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export default {
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../../coverage/libs/user/domain',
coverageDirectory: '../../../coverage/libs/users/domain',
};
9 changes: 9 additions & 0 deletions libs/users/domain/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "users-domain",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/users/domain/src",
"projectType": "library",
"tags": [],
"// targets": "to see all targets run: nx show project users-domain --web",
"targets": {}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ describe('User Entity', () => {
user.name = 'Jane Doe';
expect(user.name).toBe('Jane Doe');
});
});
});
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ describe('UserRepository', () => {
const user = await userRepository.findById('3');
expect(user).toBeNull();
});

});
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import { User } from './user.entity';

export interface UserRepository {
findById(id: string): Promise<User | null>;
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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';
import { User } from '@users/domain';

describe('MongooseUserRepository', () => {
let repository: MongooseUserRepository;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { InjectModel } from '@nestjs/mongoose';
import { User, UserRepository } from '@user/domain';
import { User, UserRepository } from '@users/domain';
import { Model } from 'mongoose';

import { UserDocument } from './user.schema';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Test, TestingModule } from '@nestjs/testing';
import { UsersService } from '@users/application';
import { User } from '@user/domain';
import { User } from '@users/domain';

import { UsersResolver } from './users.resolver';

Expand Down
2 changes: 1 addition & 1 deletion libs/users/presentation/resolver/src/lib/users.resolver.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Args, ID, Query, Resolver, ResolveReference } from '@nestjs/graphql';
import { UsersService } from '@users/application';
import { User } from '@user/domain';
import { User } from '@users/domain';
import { UserDto } from '@users/presentation-dto';

@Resolver(() => UserDto)
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@shared/infrastructure-mongoose": [
"libs/shared/infrastructure/mongoose/src/index.ts"
],
"@user/domain": ["libs/user/domain/src/index.ts"],
"@users/domain": ["libs/users/domain/src/index.ts"],
"@users/application": ["libs/users/application/src/index.ts"],
"@users/infrastructure-mongoose": [
"libs/users/infrastructure/mongoose/src/index.ts"
Expand Down

0 comments on commit 54e38fa

Please sign in to comment.