diff --git a/angular.json b/angular.json index ae27a80..5a90a31 100644 --- a/angular.json +++ b/angular.json @@ -1,6 +1,32 @@ { "version": 1, - "projects": {}, + "projects": { + "contact-model": { + "root": "libs/contact-model", + "sourceRoot": "libs/contact-model/src", + "projectType": "library", + "schematics": {}, + "architect": { + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "libs/contact-model/tsconfig.lib.json", + "libs/contact-model/tsconfig.spec.json" + ], + "exclude": ["**/node_modules/**", "!libs/contact-model/**"] + } + }, + "test": { + "builder": "@nrwl/jest:jest", + "options": { + "jestConfig": "libs/contact-model/jest.config.js", + "tsConfig": "libs/contact-model/tsconfig.spec.json" + } + } + } + } + }, "cli": { "defaultCollection": "@nrwl/workspace" } diff --git a/libs/contact-model/README.md b/libs/contact-model/README.md new file mode 100644 index 0000000..26efe88 --- /dev/null +++ b/libs/contact-model/README.md @@ -0,0 +1,7 @@ +# contact-model + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `ng test contact-model` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/contact-model/jest.config.js b/libs/contact-model/jest.config.js new file mode 100644 index 0000000..62d3e50 --- /dev/null +++ b/libs/contact-model/jest.config.js @@ -0,0 +1,9 @@ +module.exports = { + name: 'contact-model', + preset: '../../jest.config.js', + transform: { + '^.+\\.[tj]sx?$': 'ts-jest' + }, + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'], + coverageDirectory: '../../coverage/libs/contact-model' +}; diff --git a/libs/contact-model/src/index.ts b/libs/contact-model/src/index.ts new file mode 100644 index 0000000..d56d3be --- /dev/null +++ b/libs/contact-model/src/index.ts @@ -0,0 +1 @@ +export * from './lib/contact-model'; diff --git a/libs/contact-model/src/lib/contact-model.ts b/libs/contact-model/src/lib/contact-model.ts new file mode 100644 index 0000000..e69de29 diff --git a/libs/contact-model/tsconfig.json b/libs/contact-model/tsconfig.json new file mode 100644 index 0000000..e5decd5 --- /dev/null +++ b/libs/contact-model/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "types": ["node", "jest"] + }, + "include": ["**/*.ts"] +} diff --git a/libs/contact-model/tsconfig.lib.json b/libs/contact-model/tsconfig.lib.json new file mode 100644 index 0000000..7096f23 --- /dev/null +++ b/libs/contact-model/tsconfig.lib.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "types": [] + }, + "exclude": ["**/*.spec.ts"], + "include": ["**/*.ts"] +} diff --git a/libs/contact-model/tsconfig.spec.json b/libs/contact-model/tsconfig.spec.json new file mode 100644 index 0000000..559410b --- /dev/null +++ b/libs/contact-model/tsconfig.spec.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": [ + "**/*.spec.ts", + "**/*.spec.tsx", + "**/*.spec.js", + "**/*.spec.jsx", + "**/*.d.ts" + ] +} diff --git a/libs/contact-model/tslint.json b/libs/contact-model/tslint.json new file mode 100644 index 0000000..04809f8 --- /dev/null +++ b/libs/contact-model/tslint.json @@ -0,0 +1 @@ +{ "extends": "../../tslint.json", "rules": [] } diff --git a/nx.json b/nx.json index c582352..86d5a07 100644 --- a/nx.json +++ b/nx.json @@ -7,5 +7,9 @@ "tslint.json": "*", "nx.json": "*" }, - "projects": {} + "projects": { + "contact-model": { + "tags": [] + } + } } diff --git a/tsconfig.json b/tsconfig.json index a5099b5..8b17d83 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,9 @@ "skipLibCheck": true, "skipDefaultLibCheck": true, "baseUrl": ".", - "paths": {} + "paths": { + "@nested-forms/contact-model": ["libs/contact-model/src/index.ts"] + } }, "exclude": ["node_modules", "tmp"] } diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000..9172f56 --- /dev/null +++ b/tslint.json @@ -0,0 +1,61 @@ +{ + "rulesDirectory": ["node_modules/@nrwl/workspace/src/tslint"], + "rules": { + "arrow-return-shorthand": true, + "callable-types": true, + "class-name": true, + "deprecation": { + "severity": "warn" + }, + "forin": true, + "import-blacklist": [true, "rxjs/Rx"], + "interface-over-type-literal": true, + "member-access": false, + "member-ordering": [ + true, + { + "order": [ + "static-field", + "instance-field", + "static-method", + "instance-method" + ] + } + ], + "no-arg": true, + "no-bitwise": true, + "no-console": [true, "debug", "info", "time", "timeEnd", "trace"], + "no-construct": true, + "no-debugger": true, + "no-duplicate-super": true, + "no-empty": false, + "no-empty-interface": true, + "no-eval": true, + "no-inferrable-types": [true, "ignore-params"], + "no-misused-new": true, + "no-non-null-assertion": true, + "no-shadowed-variable": true, + "no-string-literal": false, + "no-string-throw": true, + "no-switch-case-fall-through": true, + "no-unnecessary-initializer": true, + "no-unused-expression": true, + "no-var-keyword": true, + "object-literal-sort-keys": false, + "prefer-const": true, + "radix": true, + "triple-equals": [true, "allow-null-check"], + "unified-signatures": true, + "variable-name": false, + + "nx-enforce-module-boundaries": [ + true, + { + "allow": [], + "depConstraints": [ + { "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] } + ] + } + ] + } +}