From f0356965d21dfe02655007371de461a76c6a69ce Mon Sep 17 00:00:00 2001 From: zhumeisongsong Date: Sat, 7 Dec 2024 10:37:27 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20initial=20tasks=20applicati?= =?UTF-8?q?on/domain/interface-adapters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/tasks/application/README.md | 7 ++++++ libs/tasks/application/eslint.config.js | 3 +++ libs/tasks/application/jest.config.ts | 10 +++++++++ libs/tasks/application/project.json | 9 ++++++++ libs/tasks/application/src/index.ts | 1 + .../src/lib/tasks-application.spec.ts | 7 ++++++ .../application/src/lib/tasks-application.ts | 3 +++ libs/tasks/application/tsconfig.json | 22 +++++++++++++++++++ libs/tasks/application/tsconfig.lib.json | 11 ++++++++++ libs/tasks/application/tsconfig.spec.json | 14 ++++++++++++ libs/tasks/domain/README.md | 7 ++++++ libs/tasks/domain/eslint.config.js | 3 +++ libs/tasks/domain/jest.config.ts | 10 +++++++++ libs/tasks/domain/project.json | 9 ++++++++ libs/tasks/domain/src/index.ts | 1 + .../tasks/domain/src/lib/tasks-domain.spec.ts | 7 ++++++ libs/tasks/domain/src/lib/tasks-domain.ts | 3 +++ libs/tasks/domain/tsconfig.json | 22 +++++++++++++++++++ libs/tasks/domain/tsconfig.lib.json | 11 ++++++++++ libs/tasks/domain/tsconfig.spec.json | 14 ++++++++++++ libs/tasks/interface-adapters/README.md | 7 ++++++ .../tasks/interface-adapters/eslint.config.js | 3 +++ libs/tasks/interface-adapters/jest.config.ts | 10 +++++++++ libs/tasks/interface-adapters/project.json | 9 ++++++++ libs/tasks/interface-adapters/src/index.ts | 1 + .../src/lib/tasks-interface-adapters.spec.ts | 7 ++++++ .../src/lib/tasks-interface-adapters.ts | 3 +++ libs/tasks/interface-adapters/tsconfig.json | 22 +++++++++++++++++++ .../interface-adapters/tsconfig.lib.json | 11 ++++++++++ .../interface-adapters/tsconfig.spec.json | 14 ++++++++++++ tsconfig.base.json | 5 +++++ 31 files changed, 266 insertions(+) create mode 100644 libs/tasks/application/README.md create mode 100644 libs/tasks/application/eslint.config.js create mode 100644 libs/tasks/application/jest.config.ts create mode 100644 libs/tasks/application/project.json create mode 100644 libs/tasks/application/src/index.ts create mode 100644 libs/tasks/application/src/lib/tasks-application.spec.ts create mode 100644 libs/tasks/application/src/lib/tasks-application.ts create mode 100644 libs/tasks/application/tsconfig.json create mode 100644 libs/tasks/application/tsconfig.lib.json create mode 100644 libs/tasks/application/tsconfig.spec.json create mode 100644 libs/tasks/domain/README.md create mode 100644 libs/tasks/domain/eslint.config.js create mode 100644 libs/tasks/domain/jest.config.ts create mode 100644 libs/tasks/domain/project.json create mode 100644 libs/tasks/domain/src/index.ts create mode 100644 libs/tasks/domain/src/lib/tasks-domain.spec.ts create mode 100644 libs/tasks/domain/src/lib/tasks-domain.ts create mode 100644 libs/tasks/domain/tsconfig.json create mode 100644 libs/tasks/domain/tsconfig.lib.json create mode 100644 libs/tasks/domain/tsconfig.spec.json create mode 100644 libs/tasks/interface-adapters/README.md create mode 100644 libs/tasks/interface-adapters/eslint.config.js create mode 100644 libs/tasks/interface-adapters/jest.config.ts create mode 100644 libs/tasks/interface-adapters/project.json create mode 100644 libs/tasks/interface-adapters/src/index.ts create mode 100644 libs/tasks/interface-adapters/src/lib/tasks-interface-adapters.spec.ts create mode 100644 libs/tasks/interface-adapters/src/lib/tasks-interface-adapters.ts create mode 100644 libs/tasks/interface-adapters/tsconfig.json create mode 100644 libs/tasks/interface-adapters/tsconfig.lib.json create mode 100644 libs/tasks/interface-adapters/tsconfig.spec.json diff --git a/libs/tasks/application/README.md b/libs/tasks/application/README.md new file mode 100644 index 0000000..cb41396 --- /dev/null +++ b/libs/tasks/application/README.md @@ -0,0 +1,7 @@ +# tasks-application + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test tasks-application` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/tasks/application/eslint.config.js b/libs/tasks/application/eslint.config.js new file mode 100644 index 0000000..07e518f --- /dev/null +++ b/libs/tasks/application/eslint.config.js @@ -0,0 +1,3 @@ +const baseConfig = require('../../../eslint.config.js'); + +module.exports = [...baseConfig]; diff --git a/libs/tasks/application/jest.config.ts b/libs/tasks/application/jest.config.ts new file mode 100644 index 0000000..cbb6dfe --- /dev/null +++ b/libs/tasks/application/jest.config.ts @@ -0,0 +1,10 @@ +export default { + displayName: 'tasks-application', + preset: '../../../jest.preset.js', + testEnvironment: 'node', + transform: { + '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../../coverage/libs/tasks/application', +}; diff --git a/libs/tasks/application/project.json b/libs/tasks/application/project.json new file mode 100644 index 0000000..e15cda4 --- /dev/null +++ b/libs/tasks/application/project.json @@ -0,0 +1,9 @@ +{ + "name": "tasks-application", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/tasks/application/src", + "projectType": "library", + "tags": [], + "// targets": "to see all targets run: nx show project tasks-application --web", + "targets": {} +} diff --git a/libs/tasks/application/src/index.ts b/libs/tasks/application/src/index.ts new file mode 100644 index 0000000..e9187da --- /dev/null +++ b/libs/tasks/application/src/index.ts @@ -0,0 +1 @@ +export * from './lib/tasks-application'; diff --git a/libs/tasks/application/src/lib/tasks-application.spec.ts b/libs/tasks/application/src/lib/tasks-application.spec.ts new file mode 100644 index 0000000..2640f80 --- /dev/null +++ b/libs/tasks/application/src/lib/tasks-application.spec.ts @@ -0,0 +1,7 @@ +import { tasksApplication } from './tasks-application'; + +describe('tasksApplication', () => { + it('should work', () => { + expect(tasksApplication()).toEqual('tasks-application'); + }); +}); diff --git a/libs/tasks/application/src/lib/tasks-application.ts b/libs/tasks/application/src/lib/tasks-application.ts new file mode 100644 index 0000000..75e4849 --- /dev/null +++ b/libs/tasks/application/src/lib/tasks-application.ts @@ -0,0 +1,3 @@ +export function tasksApplication(): string { + return 'tasks-application'; +} diff --git a/libs/tasks/application/tsconfig.json b/libs/tasks/application/tsconfig.json new file mode 100644 index 0000000..0dc79ca --- /dev/null +++ b/libs/tasks/application/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/tasks/application/tsconfig.lib.json b/libs/tasks/application/tsconfig.lib.json new file mode 100644 index 0000000..e583571 --- /dev/null +++ b/libs/tasks/application/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/tasks/application/tsconfig.spec.json b/libs/tasks/application/tsconfig.spec.json new file mode 100644 index 0000000..69a251f --- /dev/null +++ b/libs/tasks/application/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/libs/tasks/domain/README.md b/libs/tasks/domain/README.md new file mode 100644 index 0000000..f8ef96f --- /dev/null +++ b/libs/tasks/domain/README.md @@ -0,0 +1,7 @@ +# tasks-domain + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test tasks-domain` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/tasks/domain/eslint.config.js b/libs/tasks/domain/eslint.config.js new file mode 100644 index 0000000..07e518f --- /dev/null +++ b/libs/tasks/domain/eslint.config.js @@ -0,0 +1,3 @@ +const baseConfig = require('../../../eslint.config.js'); + +module.exports = [...baseConfig]; diff --git a/libs/tasks/domain/jest.config.ts b/libs/tasks/domain/jest.config.ts new file mode 100644 index 0000000..acbeb85 --- /dev/null +++ b/libs/tasks/domain/jest.config.ts @@ -0,0 +1,10 @@ +export default { + displayName: 'tasks-domain', + preset: '../../../jest.preset.js', + testEnvironment: 'node', + transform: { + '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../../coverage/libs/tasks/domain', +}; diff --git a/libs/tasks/domain/project.json b/libs/tasks/domain/project.json new file mode 100644 index 0000000..2a52b4f --- /dev/null +++ b/libs/tasks/domain/project.json @@ -0,0 +1,9 @@ +{ + "name": "tasks-domain", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/tasks/domain/src", + "projectType": "library", + "tags": [], + "// targets": "to see all targets run: nx show project tasks-domain --web", + "targets": {} +} diff --git a/libs/tasks/domain/src/index.ts b/libs/tasks/domain/src/index.ts new file mode 100644 index 0000000..810dfe0 --- /dev/null +++ b/libs/tasks/domain/src/index.ts @@ -0,0 +1 @@ +export * from './lib/tasks-domain'; diff --git a/libs/tasks/domain/src/lib/tasks-domain.spec.ts b/libs/tasks/domain/src/lib/tasks-domain.spec.ts new file mode 100644 index 0000000..f6e92b2 --- /dev/null +++ b/libs/tasks/domain/src/lib/tasks-domain.spec.ts @@ -0,0 +1,7 @@ +import { tasksDomain } from './tasks-domain'; + +describe('tasksDomain', () => { + it('should work', () => { + expect(tasksDomain()).toEqual('tasks-domain'); + }); +}); diff --git a/libs/tasks/domain/src/lib/tasks-domain.ts b/libs/tasks/domain/src/lib/tasks-domain.ts new file mode 100644 index 0000000..f474aea --- /dev/null +++ b/libs/tasks/domain/src/lib/tasks-domain.ts @@ -0,0 +1,3 @@ +export function tasksDomain(): string { + return 'tasks-domain'; +} diff --git a/libs/tasks/domain/tsconfig.json b/libs/tasks/domain/tsconfig.json new file mode 100644 index 0000000..0dc79ca --- /dev/null +++ b/libs/tasks/domain/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/tasks/domain/tsconfig.lib.json b/libs/tasks/domain/tsconfig.lib.json new file mode 100644 index 0000000..e583571 --- /dev/null +++ b/libs/tasks/domain/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/tasks/domain/tsconfig.spec.json b/libs/tasks/domain/tsconfig.spec.json new file mode 100644 index 0000000..69a251f --- /dev/null +++ b/libs/tasks/domain/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/libs/tasks/interface-adapters/README.md b/libs/tasks/interface-adapters/README.md new file mode 100644 index 0000000..ce223c1 --- /dev/null +++ b/libs/tasks/interface-adapters/README.md @@ -0,0 +1,7 @@ +# tasks-interface-adapters + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test tasks-interface-adapters` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/tasks/interface-adapters/eslint.config.js b/libs/tasks/interface-adapters/eslint.config.js new file mode 100644 index 0000000..07e518f --- /dev/null +++ b/libs/tasks/interface-adapters/eslint.config.js @@ -0,0 +1,3 @@ +const baseConfig = require('../../../eslint.config.js'); + +module.exports = [...baseConfig]; diff --git a/libs/tasks/interface-adapters/jest.config.ts b/libs/tasks/interface-adapters/jest.config.ts new file mode 100644 index 0000000..bcc72eb --- /dev/null +++ b/libs/tasks/interface-adapters/jest.config.ts @@ -0,0 +1,10 @@ +export default { + displayName: 'tasks-interface-adapters', + preset: '../../../jest.preset.js', + testEnvironment: 'node', + transform: { + '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../../coverage/libs/tasks/interface-adapters', +}; diff --git a/libs/tasks/interface-adapters/project.json b/libs/tasks/interface-adapters/project.json new file mode 100644 index 0000000..7e2cdb7 --- /dev/null +++ b/libs/tasks/interface-adapters/project.json @@ -0,0 +1,9 @@ +{ + "name": "tasks-interface-adapters", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/tasks/interface-adapters/src", + "projectType": "library", + "tags": [], + "// targets": "to see all targets run: nx show project tasks-interface-adapters --web", + "targets": {} +} diff --git a/libs/tasks/interface-adapters/src/index.ts b/libs/tasks/interface-adapters/src/index.ts new file mode 100644 index 0000000..a6214aa --- /dev/null +++ b/libs/tasks/interface-adapters/src/index.ts @@ -0,0 +1 @@ +export * from './lib/tasks-interface-adapters'; diff --git a/libs/tasks/interface-adapters/src/lib/tasks-interface-adapters.spec.ts b/libs/tasks/interface-adapters/src/lib/tasks-interface-adapters.spec.ts new file mode 100644 index 0000000..a33f1f3 --- /dev/null +++ b/libs/tasks/interface-adapters/src/lib/tasks-interface-adapters.spec.ts @@ -0,0 +1,7 @@ +import { tasksInterfaceAdapters } from './tasks-interface-adapters'; + +describe('tasksInterfaceAdapters', () => { + it('should work', () => { + expect(tasksInterfaceAdapters()).toEqual('tasks-interface-adapters'); + }); +}); diff --git a/libs/tasks/interface-adapters/src/lib/tasks-interface-adapters.ts b/libs/tasks/interface-adapters/src/lib/tasks-interface-adapters.ts new file mode 100644 index 0000000..91f284e --- /dev/null +++ b/libs/tasks/interface-adapters/src/lib/tasks-interface-adapters.ts @@ -0,0 +1,3 @@ +export function tasksInterfaceAdapters(): string { + return 'tasks-interface-adapters'; +} diff --git a/libs/tasks/interface-adapters/tsconfig.json b/libs/tasks/interface-adapters/tsconfig.json new file mode 100644 index 0000000..0dc79ca --- /dev/null +++ b/libs/tasks/interface-adapters/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/tasks/interface-adapters/tsconfig.lib.json b/libs/tasks/interface-adapters/tsconfig.lib.json new file mode 100644 index 0000000..e583571 --- /dev/null +++ b/libs/tasks/interface-adapters/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/tasks/interface-adapters/tsconfig.spec.json b/libs/tasks/interface-adapters/tsconfig.spec.json new file mode 100644 index 0000000..69a251f --- /dev/null +++ b/libs/tasks/interface-adapters/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 e482b87..eda1584 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -25,6 +25,11 @@ "@shared/infrastructure-mongoose": [ "libs/shared/infrastructure/mongoose/src/index.ts" ], + "@tasks/application": ["libs/tasks/application/src/index.ts"], + "@tasks/domain": ["libs/tasks/domain/src/index.ts"], + "@tasks/interface-adapters": [ + "libs/tasks/interface-adapters/src/index.ts" + ], "@users/application": ["libs/users/application/src/index.ts"], "@users/domain": ["libs/users/domain/src/index.ts"], "@users/infrastructure-mongoose": [