code cleanup and version 1.0.0-alpha.1 release
This commit is contained in:
		
							parent
							
								
									a8999f81c7
								
							
						
					
					
						commit
						fc543977fb
					
				
							
								
								
									
										22
									
								
								angular.json
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								angular.json
									
									
									
									
									
								
							| @ -3,7 +3,7 @@ | |||||||
|   "version": 1, |   "version": 1, | ||||||
|   "newProjectRoot": "projects", |   "newProjectRoot": "projects", | ||||||
|   "projects": { |   "projects": { | ||||||
|     "data": { |     "demo": { | ||||||
|       "projectType": "application", |       "projectType": "application", | ||||||
|       "schematics": {}, |       "schematics": {}, | ||||||
|       "root": "", |       "root": "", | ||||||
| @ -121,33 +121,33 @@ | |||||||
|         } |         } | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "@poweredsoft/data": { |     "data": { | ||||||
|       "projectType": "library", |       "projectType": "library", | ||||||
|       "root": "projects/poweredsoft/data", |       "root": "projects/data", | ||||||
|       "sourceRoot": "projects/poweredsoft/data/src", |       "sourceRoot": "projects/data/src", | ||||||
|       "prefix": "lib", |       "prefix": "lib", | ||||||
|       "architect": { |       "architect": { | ||||||
|         "build": { |         "build": { | ||||||
|           "builder": "@angular-devkit/build-ng-packagr:build", |           "builder": "@angular-devkit/build-ng-packagr:build", | ||||||
|           "options": { |           "options": { | ||||||
|             "tsConfig": "projects/poweredsoft/data/tsconfig.lib.json", |             "tsConfig": "projects/data/tsconfig.lib.json", | ||||||
|             "project": "projects/poweredsoft/data/ng-package.json" |             "project": "projects/data/ng-package.json" | ||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "test": { |         "test": { | ||||||
|           "builder": "@angular-devkit/build-angular:karma", |           "builder": "@angular-devkit/build-angular:karma", | ||||||
|           "options": { |           "options": { | ||||||
|             "main": "projects/poweredsoft/data/src/test.ts", |             "main": "projects/data/src/test.ts", | ||||||
|             "tsConfig": "projects/poweredsoft/data/tsconfig.spec.json", |             "tsConfig": "projects/data/tsconfig.spec.json", | ||||||
|             "karmaConfig": "projects/poweredsoft/data/karma.conf.js" |             "karmaConfig": "projects/data/karma.conf.js" | ||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "lint": { |         "lint": { | ||||||
|           "builder": "@angular-devkit/build-angular:tslint", |           "builder": "@angular-devkit/build-angular:tslint", | ||||||
|           "options": { |           "options": { | ||||||
|             "tsConfig": [ |             "tsConfig": [ | ||||||
|               "projects/poweredsoft/data/tsconfig.lib.json", |               "projects/data/tsconfig.lib.json", | ||||||
|               "projects/poweredsoft/data/tsconfig.spec.json" |               "projects/data/tsconfig.spec.json" | ||||||
|             ], |             ], | ||||||
|             "exclude": [ |             "exclude": [ | ||||||
|               "**/node_modules/**" |               "**/node_modules/**" | ||||||
|  | |||||||
							
								
								
									
										14093
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										14093
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										16
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								package.json
									
									
									
									
									
								
							| @ -2,16 +2,11 @@ | |||||||
|   "name": "data", |   "name": "data", | ||||||
|   "version": "0.0.30", |   "version": "0.0.30", | ||||||
|   "scripts": { |   "scripts": { | ||||||
|     "ng": "ng", |     "serve": "ng serve", | ||||||
|     "start": "ng serve", |     "build": "ng build data", | ||||||
|     "build": "ng build", |     "publish": "npm publish dist/data --access public" | ||||||
|     "test": "ng test", |  | ||||||
|     "lint": "ng lint", |  | ||||||
|     "e2e": "ng e2e", |  | ||||||
|     "build-lib": "ng build @poweredsoft/data", |  | ||||||
|     "publish-lib": "npm publish dist/poweredsoft/data" |  | ||||||
|   }, |   }, | ||||||
|   "private": true, |   "private": false, | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "@angular/animations": "~8.2.4", |     "@angular/animations": "~8.2.4", | ||||||
|     "@angular/common": "~8.2.4", |     "@angular/common": "~8.2.4", | ||||||
| @ -48,5 +43,6 @@ | |||||||
|     "tsickle": "^0.37.0", |     "tsickle": "^0.37.0", | ||||||
|     "tslint": "~5.15.0", |     "tslint": "~5.15.0", | ||||||
|     "typescript": "~3.5.3" |     "typescript": "~3.5.3" | ||||||
|   } |   }, | ||||||
|  |   "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610" | ||||||
| } | } | ||||||
|  | |||||||
							
								
								
									
										7
									
								
								projects/data/ng-package.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								projects/data/ng-package.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,7 @@ | |||||||
|  | { | ||||||
|  |   "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", | ||||||
|  |   "dest": "../../dist/data", | ||||||
|  |   "lib": { | ||||||
|  |     "entryFile": "src/public-api.ts" | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										8
									
								
								projects/data/package.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								projects/data/package.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,8 @@ | |||||||
|  | { | ||||||
|  |   "name": "@openharbor/data", | ||||||
|  |   "version": "1.0.0-alpha.1", | ||||||
|  |   "repository": "https://git.openharbor.io/Open-Harbor/ts-data", | ||||||
|  |   "peerDependencies": { | ||||||
|  |     "rxjs": "^6.5.3" | ||||||
|  |   } | ||||||
|  | } | ||||||
| @ -157,7 +157,7 @@ export class DataSource<TModel> implements IDataSource<TModel> | |||||||
|             map(t => { |             map(t => { | ||||||
|                 this._notifyMessageSubject.next({ |                 this._notifyMessageSubject.next({ | ||||||
|                     type: 'success', |                     type: 'success', | ||||||
|                     message: 'COMMAND_EXECUTED_SUCCESFULLY', |                     message: 'COMMAND_EXECUTED_SUCCESSFULLY', | ||||||
|                     messageParams: { |                     messageParams: { | ||||||
|                         command: name |                         command: name | ||||||
|                     } |                     } | ||||||
| @ -179,7 +179,7 @@ export class DataSource<TModel> implements IDataSource<TModel> | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private _query() : Observable<IQueryExecutionResult<TModel> & IQueryExecutionGroupResult<TModel>> { |     private _query() : Observable<IQueryExecutionResult<TModel> & IQueryExecutionGroupResult<TModel>> { | ||||||
|         return Observable.create((o: Observer<IQueryExecutionResult<TModel> & IQueryExecutionGroupResult<TModel>>) => { |       return new Observable<IQueryExecutionResult<TModel> & IQueryExecutionGroupResult<TModel>>((o: Observer<IQueryExecutionResult<TModel> & IQueryExecutionGroupResult<TModel>>) => { | ||||||
|         this._loadingSubject.next(true); |         this._loadingSubject.next(true); | ||||||
|         this.options.transport.query.adapter.handle(this._criteria) |         this.options.transport.query.adapter.handle(this._criteria) | ||||||
|           .pipe( |           .pipe( | ||||||
| @ -194,14 +194,14 @@ export class DataSource<TModel> implements IDataSource<TModel> | |||||||
|               o.next(result); |               o.next(result); | ||||||
|               this._dataSubject.next(this.data); |               this._dataSubject.next(this.data); | ||||||
|               this._notifyMessageSubject.next({ |               this._notifyMessageSubject.next({ | ||||||
|                             message: 'NEW_DATA_READ_SUCCESFULLY', |                 message: 'NEW_DATA_READ_SUCCESSFULLY', | ||||||
|                 type: 'info' |                 type: 'info' | ||||||
|               }); |               }); | ||||||
|             }, |             }, | ||||||
|             err => { |             err => { | ||||||
|               o.error(err); |               o.error(err); | ||||||
|               this._notifyMessageSubject.next({ |               this._notifyMessageSubject.next({ | ||||||
|                             message: 'UNEXPECTED_ERROR_OCCURED', |                 message: 'UNEXPECTED_ERROR_OCCURRED', | ||||||
|                 type: 'error' |                 type: 'error' | ||||||
|               }); |               }); | ||||||
|             } |             } | ||||||
| @ -219,15 +219,13 @@ export class DataSource<TModel> implements IDataSource<TModel> | |||||||
|         return this.refresh(); |         return this.refresh(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     excuteQuery<TQuery extends IQueryCriteria>(query: TQuery): Observable<IQueryExecutionGroupResult<TModel> & IQueryExecutionGroupResult<TModel>>{ |     executeQuery<TQuery extends IQueryCriteria>(query: TQuery): Observable<IQueryExecutionGroupResult<TModel>>{ | ||||||
|         return this.options.transport.query.adapter.handle(query); |         return this.options.transport.query.adapter.handle(query); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     refresh() { |     refresh() { | ||||||
|         return this._query().subscribe( |         return this._query() | ||||||
|             res => {}, |           .subscribe(); | ||||||
|             err => {}   |  | ||||||
|         ); |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     get sorts() { |     get sorts() { | ||||||
| @ -10,7 +10,7 @@ export interface IDataSource<TModel> | |||||||
|     resolveCommandModelByName<T extends any>(event: IResolveCommandModelEvent<TModel>) : Observable<T>; |     resolveCommandModelByName<T extends any>(event: IResolveCommandModelEvent<TModel>) : Observable<T>; | ||||||
|     executeCommandByName<TCommand, TResult>(name: string, command: TCommand) : Observable<TResult>; |     executeCommandByName<TCommand, TResult>(name: string, command: TCommand) : Observable<TResult>; | ||||||
|     query<TQuery extends IQueryCriteria>(query: TQuery); |     query<TQuery extends IQueryCriteria>(query: TQuery); | ||||||
|     excuteQuery<TQuery extends IQueryCriteria>(query: TQuery): Observable<IQueryExecutionGroupResult<TModel> & IQueryExecutionGroupResult<TModel>>; |     executeQuery<TQuery extends IQueryCriteria>(query: TQuery): Observable<IQueryExecutionGroupResult<TModel> & IQueryExecutionGroupResult<TModel>>; | ||||||
|     refresh(); |     refresh(); | ||||||
|     resolveIdField<TKeyType extends any>(model: TModel) : TKeyType; |     resolveIdField<TKeyType extends any>(model: TModel) : TKeyType; | ||||||
|     clear(); |     clear(); | ||||||
| @ -1,5 +1,5 @@ | |||||||
| { | { | ||||||
|   "extends": "../../../tsconfig.json", |   "extends": "../../tsconfig.json", | ||||||
|   "compilerOptions": { |   "compilerOptions": { | ||||||
|     "outDir": "../../../out-tsc/lib", |     "outDir": "../../../out-tsc/lib", | ||||||
|     "target": "es2015", |     "target": "es2015", | ||||||
| @ -1,5 +1,5 @@ | |||||||
| { | { | ||||||
|   "extends": "../../../tsconfig.json", |   "extends": "../../tsconfig.json", | ||||||
|   "compilerOptions": { |   "compilerOptions": { | ||||||
|     "outDir": "../../../out-tsc/spec", |     "outDir": "../../../out-tsc/spec", | ||||||
|     "types": [ |     "types": [ | ||||||
| @ -1,5 +1,5 @@ | |||||||
| { | { | ||||||
|   "extends": "../../../tslint.json", |   "extends": "../../tslint.json", | ||||||
|   "rules": { |   "rules": { | ||||||
|     "directive-selector": [ |     "directive-selector": [ | ||||||
|       true, |       true, | ||||||
| @ -1,7 +0,0 @@ | |||||||
| { |  | ||||||
|   "$schema": "../../../node_modules/ng-packagr/ng-package.schema.json", |  | ||||||
|   "dest": "../../../dist/poweredsoft/data", |  | ||||||
|   "lib": { |  | ||||||
|     "entryFile": "src/public-api.ts" |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| @ -1,7 +0,0 @@ | |||||||
| { |  | ||||||
|   "name": "@poweredsoft/data", |  | ||||||
|   "version": "0.0.36", |  | ||||||
|   "peerDependencies": { |  | ||||||
|     "rxjs": "^6.5.3" |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| @ -1,31 +0,0 @@ | |||||||
| import { TestBed, async } from '@angular/core/testing'; |  | ||||||
| import { AppComponent } from './app.component'; |  | ||||||
| 
 |  | ||||||
| describe('AppComponent', () => { |  | ||||||
|   beforeEach(async(() => { |  | ||||||
|     TestBed.configureTestingModule({ |  | ||||||
|       declarations: [ |  | ||||||
|         AppComponent |  | ||||||
|       ], |  | ||||||
|     }).compileComponents(); |  | ||||||
|   })); |  | ||||||
| 
 |  | ||||||
|   it('should create the app', () => { |  | ||||||
|     const fixture = TestBed.createComponent(AppComponent); |  | ||||||
|     const app = fixture.debugElement.componentInstance; |  | ||||||
|     expect(app).toBeTruthy(); |  | ||||||
|   }); |  | ||||||
| 
 |  | ||||||
|   it(`should have as title 'data'`, () => { |  | ||||||
|     const fixture = TestBed.createComponent(AppComponent); |  | ||||||
|     const app = fixture.debugElement.componentInstance; |  | ||||||
|     expect(app.title).toEqual('data'); |  | ||||||
|   }); |  | ||||||
| 
 |  | ||||||
|   it('should render title', () => { |  | ||||||
|     const fixture = TestBed.createComponent(AppComponent); |  | ||||||
|     fixture.detectChanges(); |  | ||||||
|     const compiled = fixture.debugElement.nativeElement; |  | ||||||
|     expect(compiled.querySelector('.content span').textContent).toContain('data app is running!'); |  | ||||||
|   }); |  | ||||||
| }); |  | ||||||
| @ -1,9 +1,18 @@ | |||||||
| import { Component, OnInit, Pipe } from '@angular/core'; | import {Component, OnInit} from '@angular/core'; | ||||||
| import { IDataSource } from 'projects/poweredsoft/data/src/lib/IDataSource'; | import {IDataSourceNotifyMessage} from '../../projects/data/src/lib/IDataSourceNotifyMessage'; | ||||||
| import { IDataSourceNotifyMessage } from 'projects/poweredsoft/data/src/lib/IDataSourceNotifyMessage'; | import { | ||||||
| import { DataSource, IDataSourceTransportOptions, IDataSourceQueryAdapterOptions, IQueryCriteria, IQueryExecutionResult, IQueryExecutionGroupResult, IDataSourceCommandAdapterOptions, IDataSourceValidationError } from 'projects/poweredsoft/data/src/public-api'; |   DataSource, | ||||||
| import { HttpClient } from '@angular/common/http'; |   IDataSource, | ||||||
| import { of, throwError } from 'rxjs'; |   IDataSourceCommandAdapterOptions, | ||||||
|  |   IDataSourceQueryAdapterOptions, | ||||||
|  |   IDataSourceTransportOptions, | ||||||
|  |   IDataSourceValidationError, | ||||||
|  |   IQueryCriteria, | ||||||
|  |   IQueryExecutionGroupResult, | ||||||
|  |   IQueryExecutionResult | ||||||
|  | } from '@openharbor/data'; | ||||||
|  | import {HttpClient} from '@angular/common/http'; | ||||||
|  | import {of, throwError} from 'rxjs'; | ||||||
| 
 | 
 | ||||||
| export interface MyModel { | export interface MyModel { | ||||||
|     id: number; |     id: number; | ||||||
|  | |||||||
| @ -19,12 +19,9 @@ | |||||||
|       "dom" |       "dom" | ||||||
|     ], |     ], | ||||||
|     "paths": { |     "paths": { | ||||||
|       "@poweredsoft/data": [ |       "@openharbor/data": [ | ||||||
|         "dist/poweredsoft/data" |         "./projects/data/src/public-api" | ||||||
|       ], |       ], | ||||||
|       "@poweredsoft/data/*": [ |  | ||||||
|         "dist/poweredsoft/data/*" |  | ||||||
|       ] |  | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   "angularCompilerOptions": { |   "angularCompilerOptions": { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user