From 28f56f2e85ad5bc26f3fe6cc8d1dd3961059a84c Mon Sep 17 00:00:00 2001 From: "Kevin C. Coram" Date: Wed, 4 Sep 2019 21:36:09 -0400 Subject: [PATCH] Refactor rename lib/contact-model -> lib/contact --- angular.json | 18 +++++++++--------- .../app/address-list/address-list.component.ts | 2 +- .../src/app/address/address.component.ts | 2 +- apps/parent-form/src/app/app.component.ts | 4 ++-- .../parent-form/src/app/name/name.component.ts | 2 +- libs/contact-model/README.md | 7 ------- libs/contact/README.md | 7 +++++++ libs/{contact-model => contact}/jest.config.js | 4 ++-- libs/{contact-model => contact}/src/index.ts | 0 .../src/lib/contact-model.ts | 0 .../src/lib/contact.service.spec.ts | 0 .../src/lib/contact.service.ts | 2 +- .../src/test-setup.ts | 0 libs/{contact-model => contact}/tsconfig.json | 0 .../tsconfig.lib.json | 0 .../tsconfig.spec.json | 0 libs/{contact-model => contact}/tslint.json | 0 nx.json | 2 +- tsconfig.json | 2 +- 19 files changed, 26 insertions(+), 26 deletions(-) delete mode 100644 libs/contact-model/README.md create mode 100644 libs/contact/README.md rename libs/{contact-model => contact}/jest.config.js (66%) rename libs/{contact-model => contact}/src/index.ts (100%) rename libs/{contact-model => contact}/src/lib/contact-model.ts (100%) rename libs/{contact-model => contact}/src/lib/contact.service.spec.ts (100%) rename libs/{contact-model => contact}/src/lib/contact.service.ts (92%) rename libs/{contact-model => contact}/src/test-setup.ts (100%) rename libs/{contact-model => contact}/tsconfig.json (100%) rename libs/{contact-model => contact}/tsconfig.lib.json (100%) rename libs/{contact-model => contact}/tsconfig.spec.json (100%) rename libs/{contact-model => contact}/tslint.json (100%) diff --git a/angular.json b/angular.json index e1d5572..08a32f9 100644 --- a/angular.json +++ b/angular.json @@ -1,9 +1,9 @@ { "version": 1, "projects": { - "contact-model": { - "root": "libs/contact-model", - "sourceRoot": "libs/contact-model/src", + "contact": { + "root": "libs/contact", + "sourceRoot": "libs/contact/src", "projectType": "library", "schematics": {}, "architect": { @@ -11,18 +11,18 @@ "builder": "@angular-devkit/build-angular:tslint", "options": { "tsConfig": [ - "libs/contact-model/tsconfig.lib.json", - "libs/contact-model/tsconfig.spec.json" + "libs/contact/tsconfig.lib.json", + "libs/contact/tsconfig.spec.json" ], - "exclude": ["**/node_modules/**", "!libs/contact-model/**"] + "exclude": ["**/node_modules/**", "!libs/contact/**"] } }, "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/contact-model/jest.config.js", - "tsConfig": "libs/contact-model/tsconfig.spec.json", - "setupFile": "libs/contact-model/src/test-setup.ts" + "jestConfig": "libs/contact/jest.config.js", + "tsConfig": "libs/contact/tsconfig.spec.json", + "setupFile": "libs/contact/src/test-setup.ts" } } } diff --git a/apps/parent-form/src/app/address-list/address-list.component.ts b/apps/parent-form/src/app/address-list/address-list.component.ts index 448b02a..5d0934c 100644 --- a/apps/parent-form/src/app/address-list/address-list.component.ts +++ b/apps/parent-form/src/app/address-list/address-list.component.ts @@ -1,5 +1,5 @@ import { FormGroup, FormBuilder, FormArray } from '@angular/forms'; -import { Address } from '@nested-forms/contact-model'; +import { Address } from '@nested-forms/contact'; import { Component, OnInit, Input } from '@angular/core'; @Component({ diff --git a/apps/parent-form/src/app/address/address.component.ts b/apps/parent-form/src/app/address/address.component.ts index 65ef118..34e765e 100644 --- a/apps/parent-form/src/app/address/address.component.ts +++ b/apps/parent-form/src/app/address/address.component.ts @@ -1,5 +1,5 @@ import { FormArray, FormBuilder, FormGroup, FormControl } from '@angular/forms'; -import { Address } from '@nested-forms/contact-model'; +import { Address } from '@nested-forms/contact'; import { Component, OnInit, Input } from '@angular/core'; @Component({ diff --git a/apps/parent-form/src/app/app.component.ts b/apps/parent-form/src/app/app.component.ts index 305f765..0fd1911 100644 --- a/apps/parent-form/src/app/app.component.ts +++ b/apps/parent-form/src/app/app.component.ts @@ -1,5 +1,5 @@ -import { ContactService } from './../../../../libs/contact-model/src/lib/contact.service'; -import { Contact } from '@nested-forms/contact-model'; +import { ContactService } from './../../../../libs/contact/src/lib/contact.service'; +import { Contact } from '@nested-forms/contact'; import { Component, OnInit, OnDestroy } from '@angular/core'; import { FormGroup, FormBuilder } from '@angular/forms'; import { Subscription } from 'rxjs'; diff --git a/apps/parent-form/src/app/name/name.component.ts b/apps/parent-form/src/app/name/name.component.ts index 947d980..5793c08 100644 --- a/apps/parent-form/src/app/name/name.component.ts +++ b/apps/parent-form/src/app/name/name.component.ts @@ -1,5 +1,5 @@ import { FormGroup, FormBuilder, FormControl } from '@angular/forms'; -import { Name } from '@nested-forms/contact-model'; +import { Name } from '@nested-forms/contact'; import { Component, OnInit, Input } from '@angular/core'; @Component({ diff --git a/libs/contact-model/README.md b/libs/contact-model/README.md deleted file mode 100644 index 26efe88..0000000 --- a/libs/contact-model/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# 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/README.md b/libs/contact/README.md new file mode 100644 index 0000000..ca2891f --- /dev/null +++ b/libs/contact/README.md @@ -0,0 +1,7 @@ +# contact + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `ng test contact` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/contact-model/jest.config.js b/libs/contact/jest.config.js similarity index 66% rename from libs/contact-model/jest.config.js rename to libs/contact/jest.config.js index bff341e..4c42244 100644 --- a/libs/contact-model/jest.config.js +++ b/libs/contact/jest.config.js @@ -1,9 +1,9 @@ module.exports = { - name: 'contact-model', + name: 'contact', preset: '../../jest.config.js', transform: { '^.+\\.[tj]sx?$': 'ts-jest' }, moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'], - coverageDirectory: '../../coverage/libs/contact-model', + coverageDirectory: '../../coverage/libs/contact', }; diff --git a/libs/contact-model/src/index.ts b/libs/contact/src/index.ts similarity index 100% rename from libs/contact-model/src/index.ts rename to libs/contact/src/index.ts diff --git a/libs/contact-model/src/lib/contact-model.ts b/libs/contact/src/lib/contact-model.ts similarity index 100% rename from libs/contact-model/src/lib/contact-model.ts rename to libs/contact/src/lib/contact-model.ts diff --git a/libs/contact-model/src/lib/contact.service.spec.ts b/libs/contact/src/lib/contact.service.spec.ts similarity index 100% rename from libs/contact-model/src/lib/contact.service.spec.ts rename to libs/contact/src/lib/contact.service.spec.ts diff --git a/libs/contact-model/src/lib/contact.service.ts b/libs/contact/src/lib/contact.service.ts similarity index 92% rename from libs/contact-model/src/lib/contact.service.ts rename to libs/contact/src/lib/contact.service.ts index 88a8515..b056d42 100644 --- a/libs/contact-model/src/lib/contact.service.ts +++ b/libs/contact/src/lib/contact.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import { Contact } from '@nested-forms/contact-model'; +import { Contact } from './contact-model'; import { Observable, of } from 'rxjs'; const contact: Contact = { diff --git a/libs/contact-model/src/test-setup.ts b/libs/contact/src/test-setup.ts similarity index 100% rename from libs/contact-model/src/test-setup.ts rename to libs/contact/src/test-setup.ts diff --git a/libs/contact-model/tsconfig.json b/libs/contact/tsconfig.json similarity index 100% rename from libs/contact-model/tsconfig.json rename to libs/contact/tsconfig.json diff --git a/libs/contact-model/tsconfig.lib.json b/libs/contact/tsconfig.lib.json similarity index 100% rename from libs/contact-model/tsconfig.lib.json rename to libs/contact/tsconfig.lib.json diff --git a/libs/contact-model/tsconfig.spec.json b/libs/contact/tsconfig.spec.json similarity index 100% rename from libs/contact-model/tsconfig.spec.json rename to libs/contact/tsconfig.spec.json diff --git a/libs/contact-model/tslint.json b/libs/contact/tslint.json similarity index 100% rename from libs/contact-model/tslint.json rename to libs/contact/tslint.json diff --git a/nx.json b/nx.json index 92e985e..6eb814b 100644 --- a/nx.json +++ b/nx.json @@ -8,7 +8,7 @@ "nx.json": "*" }, "projects": { - "contact-model": { + "contact": { "tags": [] }, "parent-form-e2e": { diff --git a/tsconfig.json b/tsconfig.json index 8b17d83..7dc045c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,7 @@ "skipDefaultLibCheck": true, "baseUrl": ".", "paths": { - "@nested-forms/contact-model": ["libs/contact-model/src/index.ts"] + "@nested-forms/contact": ["libs/contact/src/index.ts"] } }, "exclude": ["node_modules", "tmp"]