diff --git a/README.md b/README.md index ea55833..f2a6bbc 100644 --- a/README.md +++ b/README.md @@ -1 +1,7 @@ -Hello Common Components +# common-ui + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test common-ui` to execute the unit tests. diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..f06ef5f --- /dev/null +++ b/jest.config.js @@ -0,0 +1,20 @@ +module.exports = { + displayName: 'common-ui', + preset: '../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + stringifyContentPathRegex: '\\.(html|svg)$', + astTransformers: { + before: ['jest-preset-angular/build/InlineFilesTransformer', 'jest-preset-angular/build/StripStylesTransformer'] + } + } + }, + coverageDirectory: '../../coverage/libs/common-ui', + snapshotSerializers: [ + 'jest-preset-angular/build/serializers/no-ng-attributes', + 'jest-preset-angular/build/serializers/ng-snapshot', + 'jest-preset-angular/build/serializers/html-comment' + ] +}; diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..3b5ad4f --- /dev/null +++ b/src/index.ts @@ -0,0 +1 @@ +export * from './lib/common-ui.module'; diff --git a/src/lib/common-ui.module.ts b/src/lib/common-ui.module.ts new file mode 100644 index 0000000..e4e6413 --- /dev/null +++ b/src/lib/common-ui.module.ts @@ -0,0 +1,7 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +@NgModule({ + imports: [CommonModule] +}) +export class CommonUiModule {} diff --git a/src/test-setup.ts b/src/test-setup.ts new file mode 100644 index 0000000..1100b3e --- /dev/null +++ b/src/test-setup.ts @@ -0,0 +1 @@ +import 'jest-preset-angular/setup-jest'; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..d7a0c76 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "../../tsconfig.base.json", + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ], + "compilerOptions": { + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "angularCompilerOptions": { + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } +} diff --git a/tsconfig.lib.json b/tsconfig.lib.json new file mode 100644 index 0000000..bbcc12b --- /dev/null +++ b/tsconfig.lib.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "target": "es2015", + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "types": [], + "lib": ["dom", "es2018"] + }, + "exclude": ["src/test-setup.ts", "**/*.spec.ts"], + "include": ["**/*.ts"] +} diff --git a/tsconfig.spec.json b/tsconfig.spec.json new file mode 100644 index 0000000..cfff29a --- /dev/null +++ b/tsconfig.spec.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "files": ["src/test-setup.ts"], + "include": ["**/*.spec.ts", "**/*.d.ts"] +}