Skip to content

Commit

Permalink
feat(lib): shared domain
Browse files Browse the repository at this point in the history
  • Loading branch information
draylegend committed Sep 23, 2022
1 parent 73e4d19 commit 66b429d
Show file tree
Hide file tree
Showing 12 changed files with 160 additions and 11 deletions.
36 changes: 36 additions & 0 deletions libs/shared/domain/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"extends": ["../../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": [
"plugin:@nrwl/nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "im",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "im",
"style": "kebab-case"
}
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"rules": {}
}
]
}
7 changes: 7 additions & 0 deletions libs/shared/domain/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# shared-domain

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

## Running unit tests

Run `nx test shared-domain` to execute the unit tests.
22 changes: 22 additions & 0 deletions libs/shared/domain/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-disable */
export default {
displayName: 'shared-domain',
preset: '../../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
coverageDirectory: '../../../coverage/libs/shared/domain',
transform: {
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular',
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
};
26 changes: 26 additions & 0 deletions libs/shared/domain/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "libs/shared/domain/src",
"prefix": "im",
"targets": {
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/libs/shared/domain"],
"options": {
"jestConfig": "libs/shared/domain/jest.config.ts",
"passWithNoTests": true
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": [
"libs/shared/domain/**/*.ts",
"libs/shared/domain/**/*.html"
]
}
}
},
"tags": ["scope:shared type:domain"]
}
Empty file added libs/shared/domain/src/index.ts
Empty file.
1 change: 1 addition & 0 deletions libs/shared/domain/src/test-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import 'jest-preset-angular/setup-jest';
28 changes: 28 additions & 0 deletions libs/shared/domain/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"extends": "../../../tsconfig.base.json",
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
],
"compilerOptions": {
"target": "es2020",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}
17 changes: 17 additions & 0 deletions libs/shared/domain/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../../dist/out-tsc",
"declaration": true,
"declarationMap": true,
"inlineSources": true,
"types": []
},
"exclude": [
"src/test-setup.ts",
"**/*.spec.ts",
"jest.config.ts",
"**/*.test.ts"
],
"include": ["**/*.ts"]
}
10 changes: 10 additions & 0 deletions libs/shared/domain/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"files": ["src/test-setup.ts"],
"include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"]
}
18 changes: 9 additions & 9 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,30 @@
},
"generators": {
"@nrwl/angular:application": {
"e2eTestRunner": "cypress",
"linter": "eslint",
"prefix": "im",
"style": "scss",
"unitTestRunner": "jest"
"linter": "eslint",
"unitTestRunner": "jest",
"e2eTestRunner": "cypress",
"prefix": "im"
},
"@nrwl/angular:component": {
"style": "scss",
"changeDetection": "OnPush",
"inlineStyle": true,
"standalone": true,
"style": "scss"
"standalone": true
},
"@nrwl/angular:library": {
"linter": "eslint",
"unitTestRunner": "jest",
"changeDetection": "OnPush",
"inlineStyle": true,
"linter": "eslint",
"prefix": "im",
"skipModule": true,
"skipSelector": true,
"standalone": true,
"standaloneConfig": true,
"style": "scss",
"tags": "scope:,type:",
"unitTestRunner": "jest"
"tags": "scope:,type:"
},
"@nrwl/nest:application": {
"standaloneConfig": true,
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"@immomio/appointment/domain": ["libs/appointment/domain/src/index.ts"],
"@immomio/appointment/feature": ["libs/appointment/feature/src/index.ts"],
"@immomio/appointment/ui": ["libs/appointment/ui/src/index.ts"],
"@immomio/core/domain": ["libs/core/domain/src/index.ts"]
"@immomio/core/domain": ["libs/core/domain/src/index.ts"],
"@immomio/shared/domain": ["libs/shared/domain/src/index.ts"]
}
},
"exclude": ["node_modules", "tmp"]
Expand Down
3 changes: 2 additions & 1 deletion workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"appointment-feature": "libs/appointment/feature",
"appointment-ui": "libs/appointment/ui",
"core-domain": "libs/core/domain",
"nest-api": "apps/nest-api"
"nest-api": "apps/nest-api",
"shared-domain": "libs/shared/domain"
}
}

0 comments on commit 66b429d

Please sign in to comment.