Skip to content

Commit

Permalink
feat: ✨ initial usecase of user
Browse files Browse the repository at this point in the history
  • Loading branch information
zhumeisongsong committed Nov 14, 2024
1 parent 7fb7aef commit 1a7dd82
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cSpell.words": [
"nestjs",
"supergraph"
"supergraph",
"usecase"
]
}
7 changes: 7 additions & 0 deletions libs/user/usecase/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# user-usecase

This library was generated with [Nx](https://nx.dev).

## Running unit tests

Run `nx test user-usecase` to execute the unit tests via [Jest](https://jestjs.io).
3 changes: 3 additions & 0 deletions libs/user/usecase/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const baseConfig = require('../../../eslint.config.js');

module.exports = [...baseConfig];
10 changes: 10 additions & 0 deletions libs/user/usecase/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default {
displayName: 'user-usecase',
preset: '../../../jest.preset.js',
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../../coverage/libs/user/usecase',
};
9 changes: 9 additions & 0 deletions libs/user/usecase/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "user-usecase",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/user/usecase/src",
"projectType": "library",
"tags": [],
"// targets": "to see all targets run: nx show project user-usecase --web",
"targets": {}
}
1 change: 1 addition & 0 deletions libs/user/usecase/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/user-usecase';
7 changes: 7 additions & 0 deletions libs/user/usecase/src/lib/user-usecase.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { userUsecase } from './user-usecase';

describe('userUsecase', () => {
it('should work', () => {
expect(userUsecase()).toEqual('user-usecase');
});
});
3 changes: 3 additions & 0 deletions libs/user/usecase/src/lib/user-usecase.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function userUsecase(): string {
return 'user-usecase';
}
22 changes: 22 additions & 0 deletions libs/user/usecase/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
11 changes: 11 additions & 0 deletions libs/user/usecase/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -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"]
}
14 changes: 14 additions & 0 deletions libs/user/usecase/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
3 changes: 2 additions & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"paths": {
"@libs/config": ["libs/config/src/index.ts"],
"@prompt/domain": ["libs/prompt/domain/src/index.ts"],
"@user/domain": ["libs/user/domain/src/index.ts"]
"@user/domain": ["libs/user/domain/src/index.ts"],
"@user/usecase": ["libs/user/usecase/src/index.ts"]
}
},
"exclude": ["node_modules", "tmp"]
Expand Down

0 comments on commit 1a7dd82

Please sign in to comment.