├── src ├── assets │ └── .gitkeep ├── app │ ├── some-core-component │ │ ├── some-core-component.component.scss │ │ ├── some-core-component.component.html │ │ ├── some-core-component.component.ts │ │ └── some-core-component.component.spec.ts │ ├── app.component.scss │ ├── app.component.html │ ├── app-routing.module.ts │ ├── app.component.ts │ ├── app.module.ts │ └── app.component.spec.ts ├── favicon.ico ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── styles.scss ├── tsconfig.spec.json ├── index.html ├── tslint.json ├── main.ts ├── browserslist ├── tsconfig.app.json ├── test.ts ├── karma.conf.js └── polyfills.ts ├── projects ├── app1 │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── first │ │ │ │ ├── first.component.css │ │ │ │ ├── first.component.html │ │ │ │ ├── first.component.spec.ts │ │ │ │ └── first.component.ts │ │ │ ├── app.component.html │ │ │ ├── store │ │ │ │ ├── index.ts │ │ │ │ └── showHideElement │ │ │ │ │ ├── hide-show.actions.ts │ │ │ │ │ ├── hide-show.reducer.ts │ │ │ │ │ └── hide-show.selectors.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module-export.ts │ │ │ ├── app.component.spec.ts │ │ │ └── app.module.ts │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ ├── test.ts │ │ └── polyfills.ts │ ├── tsconfig.app.json │ ├── tslint.json │ ├── tsconfig.spec.json │ ├── browserslist │ └── karma.conf.js ├── app2 │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── second │ │ │ │ ├── second.component.css │ │ │ │ ├── second.component.html │ │ │ │ ├── second.component.spec.ts │ │ │ │ └── second.component.ts │ │ │ ├── app.component.html │ │ │ ├── store │ │ │ │ ├── index.ts │ │ │ │ └── showHideElement │ │ │ │ │ ├── hide-show.actions.ts │ │ │ │ │ ├── hide-show.reducer.ts │ │ │ │ │ └── hide-show.selectors.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module-export.ts │ │ │ ├── app.component.spec.ts │ │ │ └── app.module.ts │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ ├── test.ts │ │ └── polyfills.ts │ ├── tsconfig.app.json │ ├── tslint.json │ ├── tsconfig.spec.json │ ├── browserslist │ └── karma.conf.js ├── admin-lib │ ├── package.json │ ├── ng-package.json │ ├── src │ │ ├── lib │ │ │ ├── admin-lib.service.ts │ │ │ ├── admin-lib.module.ts │ │ │ ├── admin-lib.component.ts │ │ │ ├── admin-lib.service.spec.ts │ │ │ └── admin-lib.component.spec.ts │ │ ├── public_api.ts │ │ └── test.ts │ ├── tslint.json │ ├── tsconfig.spec.json │ ├── tsconfig.lib.json │ ├── README.md │ └── karma.conf.js ├── app1-e2e │ ├── tsconfig.e2e.json │ ├── src │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── protractor.conf.js └── app2-e2e │ ├── tsconfig.e2e.json │ ├── src │ ├── app.po.ts │ └── app.e2e-spec.ts │ └── protractor.conf.js ├── CoreApp-project-structure.gif ├── CoreApp-start_apps_separately.gif ├── e2e ├── tsconfig.e2e.json ├── src │ ├── app.po.ts │ └── app.e2e-spec.ts └── protractor.conf.js ├── .editorconfig ├── tsconfig.json ├── .gitignore ├── tslint.json ├── package.json ├── README.md └── angular.json /src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/app1/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/app2/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/app1/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/app2/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/app1/src/app/first/first.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/app2/src/app/second/second.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/some-core-component/some-core-component.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | a { 2 | padding-left: 12px; 3 | } 4 | -------------------------------------------------------------------------------- /projects/app1/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /projects/app2/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kievsash/Core-App-monorepo/HEAD/src/favicon.ico -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/app1/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /projects/app1/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/app2/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /projects/app2/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /CoreApp-project-structure.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kievsash/Core-App-monorepo/HEAD/CoreApp-project-structure.gif -------------------------------------------------------------------------------- /projects/app1/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kievsash/Core-App-monorepo/HEAD/projects/app1/src/favicon.ico -------------------------------------------------------------------------------- /projects/app2/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kievsash/Core-App-monorepo/HEAD/projects/app2/src/favicon.ico -------------------------------------------------------------------------------- /CoreApp-start_apps_separately.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kievsash/Core-App-monorepo/HEAD/CoreApp-start_apps_separately.gif -------------------------------------------------------------------------------- /src/app/some-core-component/some-core-component.component.html: -------------------------------------------------------------------------------- 1 |

2 | some-core-component works! 3 |

4 | 5 | -------------------------------------------------------------------------------- /projects/admin-lib/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "admin-lib", 3 | "version": "0.0.1", 4 | "peerDependencies": { 5 | "@angular/common": "^7.2.0", 6 | "@angular/core": "^7.2.0" 7 | } 8 | } -------------------------------------------------------------------------------- /projects/admin-lib/ng-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", 3 | "dest": "../../dist/admin-lib", 4 | "lib": { 5 | "entryFile": "src/public_api.ts" 6 | } 7 | } -------------------------------------------------------------------------------- /projects/admin-lib/src/lib/admin-lib.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable({ 4 | providedIn: 'root' 5 | }) 6 | export class AdminLibService { 7 | 8 | constructor() { } 9 | } 10 | -------------------------------------------------------------------------------- /projects/admin-lib/src/public_api.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of admin-lib 3 | */ 4 | 5 | export * from './lib/admin-lib.service'; 6 | export * from './lib/admin-lib.component'; 7 | export * from './lib/admin-lib.module'; 8 | -------------------------------------------------------------------------------- /projects/app2/src/app/second/second.component.html: -------------------------------------------------------------------------------- 1 |

2 | App2 works! 3 |

4 | 5 | 6 | -------------------------------------------------------------------------------- /projects/app1/src/app/store/index.ts: -------------------------------------------------------------------------------- 1 | 2 | import {ShowState} from './showHideElement/hide-show.reducer'; 3 | 4 | interface State { 5 | app1ShowHide: ShowState; 6 | } 7 | 8 | export * from './showHideElement/hide-show.selectors'; 9 | 10 | -------------------------------------------------------------------------------- /projects/app1/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /projects/app2/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /projects/app2/src/app/store/index.ts: -------------------------------------------------------------------------------- 1 | 2 | import {showHideReducer, ShowState} from './showHideElement/hide-show.reducer'; 3 | 4 | interface App2State { 5 | app2ShowHide: ShowState; 6 | } 7 | 8 | export * from './showHideElement/hide-show.selectors'; 9 | 10 | -------------------------------------------------------------------------------- /projects/app1/src/app/first/first.component.html: -------------------------------------------------------------------------------- 1 |

2 | App1 works! 3 |

4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /projects/app1/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-app1-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class App1Component { 9 | title = 'app1'; 10 | } 11 | -------------------------------------------------------------------------------- /projects/app2/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-app2-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class App2Component { 9 | title = 'app2'; 10 | } 11 | -------------------------------------------------------------------------------- /projects/app1-e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /projects/app2-e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /projects/admin-lib/src/lib/admin-lib.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { AdminLibComponent } from './admin-lib.component'; 3 | 4 | @NgModule({ 5 | declarations: [AdminLibComponent], 6 | imports: [ 7 | ], 8 | exports: [AdminLibComponent] 9 | }) 10 | export class AdminLibModule { } 11 | -------------------------------------------------------------------------------- /projects/app1-e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /projects/app2-e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /projects/app1/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /projects/app2/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /projects/admin-lib/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "lib", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "lib", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /projects/admin-lib/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts" 12 | ], 13 | "include": [ 14 | "**/*.spec.ts", 15 | "**/*.d.ts" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CoreApp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /projects/app1/src/app/store/showHideElement/hide-show.actions.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '@ngrx/store'; 2 | 3 | export enum HideShowActionTypes { 4 | invert = '[App1 HideShow] Invert show', 5 | } 6 | 7 | export class InvertHideShow implements Action { 8 | readonly type = HideShowActionTypes.invert; 9 | } 10 | 11 | 12 | export type HideShowActions = HideShowActionTypes; 13 | -------------------------------------------------------------------------------- /projects/app1/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /projects/app2/src/app/store/showHideElement/hide-show.actions.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '@ngrx/store'; 2 | 3 | export enum HideShowActionTypes { 4 | invert = '[App2 HideShow] Invert show', 5 | } 6 | 7 | export class InvertHideShow implements Action { 8 | readonly type = HideShowActionTypes.invert; 9 | } 10 | 11 | 12 | export type HideShowActions = HideShowActionTypes; 13 | -------------------------------------------------------------------------------- /projects/app2/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /projects/app1/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | App1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /projects/app2/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | App2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /projects/admin-lib/src/lib/admin-lib.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'lib-admin-lib', 5 | template: ` 6 |

7 | admin-lib works! 8 |

9 | `, 10 | styles: [] 11 | }) 12 | export class AdminLibComponent implements OnInit { 13 | 14 | constructor() { } 15 | 16 | ngOnInit() { 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /projects/admin-lib/src/lib/admin-lib.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminLibService } from './admin-lib.service'; 4 | 5 | describe('AdminLibService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: AdminLibService = TestBed.get(AdminLibService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /projects/app1/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /src/app/some-core-component/some-core-component.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-some-core-component', 5 | templateUrl: './some-core-component.component.html', 6 | styleUrls: ['./some-core-component.component.scss'] 7 | }) 8 | export class SomeCoreComponentComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /projects/app2/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { App2Module } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(App2Module) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /projects/app1/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /projects/app2/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /projects/app1/src/app/store/showHideElement/hide-show.reducer.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '@ngrx/store'; 2 | import {HideShowActionTypes} from './hide-show.actions'; 3 | 4 | 5 | export interface ShowState { 6 | show: boolean; 7 | } 8 | 9 | export const initialState: ShowState = { 10 | show: true 11 | }; 12 | 13 | export function showHideReducer(state = initialState, action: Action): ShowState { 14 | switch (action.type) { 15 | case HideShowActionTypes.invert: 16 | return { 17 | show: !state.show 18 | }; 19 | default: 20 | return state; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /projects/app2/src/app/store/showHideElement/hide-show.reducer.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '@ngrx/store'; 2 | import {HideShowActionTypes} from './hide-show.actions'; 3 | 4 | 5 | export interface ShowState { 6 | show: boolean; 7 | } 8 | 9 | export const initialState: ShowState = { 10 | show: true 11 | }; 12 | 13 | export function showHideReducer(state = initialState, action: Action): ShowState { 14 | switch (action.type) { 15 | case HideShowActionTypes.invert: 16 | return { 17 | show: !state.show 18 | }; 19 | default: 20 | return state; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

4 | Welcome to {{ title }}! 5 |

6 | 7 | 8 |

Outlets below:

9 | 10 | App1 11 | App2 12 | Some Core App Route 13 | 14 | 15 | -------------------------------------------------------------------------------- /projects/app1/src/app/store/showHideElement/hide-show.selectors.ts: -------------------------------------------------------------------------------- 1 | import {ShowState} from './hide-show.reducer'; 2 | import {createFeatureSelector, createSelector, MemoizedSelector} from '@ngrx/store'; 3 | 4 | const getShowValue = (state: ShowState): boolean => state.show; 5 | 6 | const selectShowState: MemoizedSelector< 7 | object, 8 | ShowState 9 | > = createFeatureSelector('app1ShowHide'); 10 | 11 | const selectShowValue: MemoizedSelector = createSelector( 12 | selectShowState, 13 | getShowValue 14 | ); 15 | 16 | export { 17 | selectShowState, 18 | selectShowValue 19 | }; 20 | -------------------------------------------------------------------------------- /projects/app2/src/app/store/showHideElement/hide-show.selectors.ts: -------------------------------------------------------------------------------- 1 | import {ShowState} from './hide-show.reducer'; 2 | import {createFeatureSelector, createSelector, MemoizedSelector} from '@ngrx/store'; 3 | 4 | const getShowValue = (state: ShowState): boolean => state.show; 5 | 6 | const selectShowState: MemoizedSelector< 7 | object, 8 | ShowState 9 | > = createFeatureSelector('app2ShowHide'); 10 | 11 | const selectShowValue: MemoizedSelector = createSelector( 12 | selectShowState, 13 | getShowValue 14 | ); 15 | 16 | export { 17 | selectShowState, 18 | selectShowValue 19 | }; 20 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "importHelpers": true, 13 | "target": "es5", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2018", 19 | "dom" 20 | ], 21 | "paths": { 22 | "admin-lib": [ 23 | "dist/admin-lib" 24 | ], 25 | "admin-lib/*": [ 26 | "dist/admin-lib/*" 27 | ] 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "include": [ 8 | "../src/**/*.ts", 9 | "../projects/app1/src/**/*.ts", 10 | "../projects/app2/src/**/*.ts", 11 | ], 12 | "exclude": [ 13 | "test.ts", 14 | "**/*.spec.ts", 15 | "../projects/app1/src/**/*spec.ts", 16 | "../projects/app2/src/**/*spec.ts", 17 | "../projects/app1/src/app/app.module.ts", 18 | "../projects/app2/src/app/app.module.ts", 19 | "../projects/app1/src/main.ts", 20 | "../projects/app2/src/main.ts", 21 | "../projects/app2/src/test.ts", 22 | "../projects/app2/src/test.ts", 23 | ] 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('Welcome to Core-App!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | })); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/app1/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /projects/app2/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/app1-e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('Welcome to app1!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/app1/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/app2-e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('Welcome to app2!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /projects/app2/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /projects/app1/src/app/first/first.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FirstComponent } from './first.component'; 4 | 5 | describe('FirstComponent', () => { 6 | let component: FirstComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FirstComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FirstComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /projects/app2/src/app/second/second.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SecondComponent } from './second.component'; 4 | 5 | describe('SecondComponent', () => { 6 | let component: SecondComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SecondComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SecondComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # profiling files 12 | chrome-profiler-events.json 13 | speed-measure-plugin.json 14 | 15 | # IDEs and editors 16 | /.idea 17 | .project 18 | .classpath 19 | .c9/ 20 | *.launch 21 | .settings/ 22 | *.sublime-workspace 23 | 24 | # IDE - VSCode 25 | .vscode/* 26 | !.vscode/settings.json 27 | !.vscode/tasks.json 28 | !.vscode/launch.json 29 | !.vscode/extensions.json 30 | .history/* 31 | 32 | # misc 33 | /.sass-cache 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | npm-debug.log 38 | yarn-error.log 39 | testem.log 40 | /typings 41 | 42 | # System Files 43 | .DS_Store 44 | Thumbs.db 45 | -------------------------------------------------------------------------------- /projects/admin-lib/src/lib/admin-lib.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminLibComponent } from './admin-lib.component'; 4 | 5 | describe('AdminLibComponent', () => { 6 | let component: AdminLibComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AdminLibComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AdminLibComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /projects/app2/src/app/second/second.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import {Store} from '@ngrx/store'; 3 | import {selectShowValue} from '../store'; 4 | import {InvertHideShow} from '../store/showHideElement/hide-show.actions'; 5 | 6 | @Component({ 7 | selector: 'app-second', 8 | templateUrl: './second.component.html', 9 | styleUrls: ['./second.component.css'] 10 | }) 11 | export class SecondComponent implements OnInit { 12 | 13 | showAdmin = true; 14 | constructor(private store: Store) { 15 | 16 | } 17 | 18 | ngOnInit() { 19 | this.store.select(selectShowValue).subscribe((value) => { 20 | this.showAdmin = value; 21 | }); 22 | } 23 | 24 | toggleAdminShow() { 25 | this.store.dispatch(new InvertHideShow()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /projects/admin-lib/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'core-js/es7/reflect'; 4 | import 'zone.js/dist/zone'; 5 | import 'zone.js/dist/zone-testing'; 6 | import { getTestBed } from '@angular/core/testing'; 7 | import { 8 | BrowserDynamicTestingModule, 9 | platformBrowserDynamicTesting 10 | } from '@angular/platform-browser-dynamic/testing'; 11 | 12 | declare const require: any; 13 | 14 | // First, initialize the Angular testing environment. 15 | getTestBed().initTestEnvironment( 16 | BrowserDynamicTestingModule, 17 | platformBrowserDynamicTesting() 18 | ); 19 | // Then we find all the tests. 20 | const context = require.context('./', true, /\.spec\.ts$/); 21 | // And load the modules. 22 | context.keys().map(context); 23 | -------------------------------------------------------------------------------- /projects/app1/src/app/first/first.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, OnInit} from '@angular/core'; 2 | import {Store} from '@ngrx/store'; 3 | import {selectShowValue} from '../store'; 4 | import {InvertHideShow} from '../store/showHideElement/hide-show.actions'; 5 | 6 | @Component({ 7 | selector: 'app-first', 8 | templateUrl: './first.component.html', 9 | styleUrls: ['./first.component.css'] 10 | }) 11 | export class FirstComponent implements OnInit { 12 | showAdmin = true; 13 | 14 | constructor(private store: Store) { 15 | 16 | } 17 | 18 | ngOnInit() { 19 | this.store.select(selectShowValue).subscribe((value) => { 20 | this.showAdmin = value; 21 | }); 22 | } 23 | 24 | toggleAdminShow() { 25 | this.store.dispatch(new InvertHideShow()); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import {SomeCoreComponentComponent} from './some-core-component/some-core-component.component'; 4 | 5 | const routes: Routes = [ 6 | { 7 | path: 'app1', 8 | loadChildren: '../../projects/app1/src/app/app.module-export#App1Module' 9 | }, 10 | { 11 | path: 'app2', 12 | loadChildren: '../../projects/app2/src/app/app.module-export#App2Module' 13 | }, 14 | { 15 | path: 'somecoreroute', 16 | component: SomeCoreComponentComponent 17 | }, 18 | { 19 | path: '', 20 | redirectTo: '', 21 | pathMatch: 'full' 22 | } 23 | ]; 24 | 25 | @NgModule({ 26 | imports: [RouterModule.forRoot(routes)], 27 | exports: [RouterModule] 28 | }) 29 | export class AppRoutingModule { } 30 | -------------------------------------------------------------------------------- /src/app/some-core-component/some-core-component.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SomeCoreComponentComponent } from './some-core-component.component'; 4 | 5 | describe('SomeCoreComponentComponent', () => { 6 | let component: SomeCoreComponentComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SomeCoreComponentComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SomeCoreComponentComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import {Store} from '@ngrx/store'; 3 | import {selectShowValue} from '../../projects/app1/src/app/store'; 4 | import {InvertHideShow as InvertHideShowApp1} from '../../projects/app1/src/app/store/showHideElement/hide-show.actions'; 5 | import {InvertHideShow as InvertHideShowApp2} from '../../projects/app2/src/app/store/showHideElement/hide-show.actions'; 6 | 7 | @Component({ 8 | selector: 'app-root', 9 | templateUrl: './app.component.html', 10 | styleUrls: ['./app.component.scss'] 11 | }) 12 | export class AppComponent { 13 | title = 'Core-App'; 14 | 15 | constructor(private store: Store) { 16 | 17 | } 18 | 19 | toggleApp1() { 20 | this.store.dispatch(new InvertHideShowApp1()); 21 | } 22 | 23 | toggleApp2() { 24 | this.store.dispatch(new InvertHideShowApp2()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /projects/admin-lib/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/lib", 5 | "target": "es2015", 6 | "module": "es2015", 7 | "moduleResolution": "node", 8 | "declaration": true, 9 | "sourceMap": true, 10 | "inlineSources": true, 11 | "emitDecoratorMetadata": true, 12 | "experimentalDecorators": true, 13 | "importHelpers": true, 14 | "types": [], 15 | "lib": [ 16 | "dom", 17 | "es2018" 18 | ] 19 | }, 20 | "angularCompilerOptions": { 21 | "annotateForClosureCompiler": true, 22 | "skipTemplateCodegen": true, 23 | "strictMetadataEmit": true, 24 | "fullTemplateTypeCheck": true, 25 | "strictInjectionParameters": true, 26 | "enableResourceInlining": true 27 | }, 28 | "exclude": [ 29 | "src/test.ts", 30 | "**/*.spec.ts" 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /projects/app1-e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /projects/app2-e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /projects/app2/src/app/app.module-export.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { App2Component } from './app.component'; 4 | import {CommonModule} from '@angular/common'; 5 | import {RouterModule, Routes} from '@angular/router'; 6 | import {SecondComponent} from './second/second.component'; 7 | import {StoreModule} from '@ngrx/store'; 8 | import {AdminLibModule} from '../../../admin-lib/src/lib/admin-lib.module'; 9 | import {showHideReducer} from './store/showHideElement/hide-show.reducer'; 10 | 11 | const routes: Routes = [ 12 | { path: '', component: SecondComponent } 13 | ]; 14 | 15 | @NgModule({ 16 | declarations: [ 17 | App2Component, 18 | SecondComponent 19 | ], 20 | imports: [ 21 | CommonModule, 22 | AdminLibModule, 23 | RouterModule.forChild(routes), 24 | StoreModule.forFeature('app2ShowHide', showHideReducer) 25 | ], 26 | providers: [], 27 | bootstrap: [App2Component] 28 | }) 29 | export class App2Module { } 30 | -------------------------------------------------------------------------------- /projects/app1/src/app/app.module-export.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { App1Component } from './app.component'; 4 | import {CommonModule} from '@angular/common'; 5 | import {RouterModule, Routes} from '@angular/router'; 6 | import {FirstComponent} from './first/first.component'; 7 | import {AdminLibModule} from '../../../admin-lib/src/lib/admin-lib.module'; 8 | import {StoreModule} from '@ngrx/store'; 9 | import {showHideReducer} from './store/showHideElement/hide-show.reducer'; 10 | 11 | const routes: Routes = [ 12 | { path: '', component: FirstComponent } 13 | ]; 14 | 15 | 16 | @NgModule({ 17 | declarations: [ 18 | App1Component, 19 | FirstComponent 20 | ], 21 | imports: [ 22 | CommonModule, 23 | AdminLibModule, 24 | RouterModule.forChild(routes), 25 | StoreModule.forFeature('app1ShowHide', showHideReducer), 26 | ], 27 | providers: [], 28 | bootstrap: [App1Component] 29 | }) 30 | export class App1Module { } 31 | 32 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppRoutingModule } from './app-routing.module'; 5 | import { AppComponent } from './app.component'; 6 | import { StoreModule } from '@ngrx/store'; 7 | import { StoreDevtoolsModule } from '@ngrx/store-devtools'; 8 | import { environment } from '../environments/environment'; 9 | import { SomeCoreComponentComponent } from './some-core-component/some-core-component.component'; 10 | import {AdminLibModule} from 'admin-lib'; 11 | 12 | @NgModule({ 13 | declarations: [ 14 | AppComponent, 15 | SomeCoreComponentComponent, 16 | SomeCoreComponentComponent 17 | ], 18 | imports: [ 19 | BrowserModule, 20 | AppRoutingModule, 21 | StoreModule.forRoot({}), 22 | !environment.production ? StoreDevtoolsModule.instrument() : [], 23 | AdminLibModule 24 | ], 25 | providers: [], 26 | bootstrap: [AppComponent] 27 | }) 28 | export class AppModule { } 29 | -------------------------------------------------------------------------------- /projects/admin-lib/README.md: -------------------------------------------------------------------------------- 1 | # AdminLib 2 | 3 | This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.2.0. 4 | 5 | ## Code scaffolding 6 | 7 | Run `ng generate component component-name --project admin-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project admin-lib`. 8 | > Note: Don't forget to add `--project admin-lib` or else it will be added to the default project in your `angular.json` file. 9 | 10 | ## Build 11 | 12 | Run `ng build admin-lib` to build the project. The build artifacts will be stored in the `dist/` directory. 13 | 14 | ## Publishing 15 | 16 | After building your library with `ng build admin-lib`, go to the dist folder `cd dist/admin-lib` and run `npm publish`. 17 | 18 | ## Running unit tests 19 | 20 | Run `ng test admin-lib` to execute the unit tests via [Karma](https://karma-runner.github.io). 21 | 22 | ## Further help 23 | 24 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 25 | -------------------------------------------------------------------------------- /src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage/Core-App'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; 32 | -------------------------------------------------------------------------------- /projects/app1/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | 4 | describe('AppComponent', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | declarations: [ 8 | AppComponent 9 | ], 10 | }).compileComponents(); 11 | })); 12 | 13 | it('should create the app', () => { 14 | const fixture = TestBed.createComponent(AppComponent); 15 | const app = fixture.debugElement.componentInstance; 16 | expect(app).toBeTruthy(); 17 | }); 18 | 19 | it(`should have as title 'app1'`, () => { 20 | const fixture = TestBed.createComponent(AppComponent); 21 | const app = fixture.debugElement.componentInstance; 22 | expect(app.title).toEqual('app1'); 23 | }); 24 | 25 | it('should render title in a h1 tag', () => { 26 | const fixture = TestBed.createComponent(AppComponent); 27 | fixture.detectChanges(); 28 | const compiled = fixture.debugElement.nativeElement; 29 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to app1!'); 30 | }); 31 | }); 32 | -------------------------------------------------------------------------------- /projects/app2/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | 4 | describe('AppComponent', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | declarations: [ 8 | AppComponent 9 | ], 10 | }).compileComponents(); 11 | })); 12 | 13 | it('should create the app', () => { 14 | const fixture = TestBed.createComponent(AppComponent); 15 | const app = fixture.debugElement.componentInstance; 16 | expect(app).toBeTruthy(); 17 | }); 18 | 19 | it(`should have as title 'app2'`, () => { 20 | const fixture = TestBed.createComponent(AppComponent); 21 | const app = fixture.debugElement.componentInstance; 22 | expect(app.title).toEqual('app2'); 23 | }); 24 | 25 | it('should render title in a h1 tag', () => { 26 | const fixture = TestBed.createComponent(AppComponent); 27 | fixture.detectChanges(); 28 | const compiled = fixture.debugElement.nativeElement; 29 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to app2!'); 30 | }); 31 | }); 32 | -------------------------------------------------------------------------------- /projects/admin-lib/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../../coverage/admin-lib'), 20 | reports: ['html', 'lcovonly'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false, 30 | restartOnFileChange: true 31 | }); 32 | }; 33 | -------------------------------------------------------------------------------- /projects/app1/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../../coverage/app1'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false, 30 | restartOnFileChange: true 31 | }); 32 | }; 33 | -------------------------------------------------------------------------------- /projects/app2/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../../coverage/app2'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false, 30 | restartOnFileChange: true 31 | }); 32 | }; 33 | -------------------------------------------------------------------------------- /projects/app2/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { App2Component } from './app.component'; 5 | import {RouterModule, Routes} from '@angular/router'; 6 | import { SecondComponent } from './second/second.component'; 7 | import {StoreModule} from '@ngrx/store'; 8 | import {AdminLibModule} from '../../../admin-lib/src/lib/admin-lib.module'; 9 | import {showHideReducer} from './store/showHideElement/hide-show.reducer'; 10 | import {environment} from '../../../app1/src/environments/environment'; 11 | import {StoreDevtoolsModule} from '@ngrx/store-devtools'; 12 | 13 | const routes: Routes = [ 14 | { path: '', component: SecondComponent } 15 | ]; 16 | 17 | @NgModule({ 18 | declarations: [ 19 | App2Component, 20 | SecondComponent 21 | ], 22 | imports: [ 23 | BrowserModule, 24 | AdminLibModule, 25 | RouterModule.forRoot(routes), 26 | StoreModule.forRoot({}), 27 | StoreModule.forFeature('app2ShowHide', showHideReducer), 28 | !environment.production ? StoreDevtoolsModule.instrument() : [] 29 | ], 30 | providers: [], 31 | bootstrap: [App2Component] 32 | }) 33 | export class App2Module { } 34 | -------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async(() => { 7 | TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule 10 | ], 11 | declarations: [ 12 | AppComponent 13 | ], 14 | }).compileComponents(); 15 | })); 16 | 17 | it('should create the app', () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.debugElement.componentInstance; 20 | expect(app).toBeTruthy(); 21 | }); 22 | 23 | it(`should have as title 'Core-App'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.debugElement.componentInstance; 26 | expect(app.title).toEqual('Core-App'); 27 | }); 28 | 29 | it('should render title in a h1 tag', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.debugElement.nativeElement; 33 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to Core-App!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /projects/app1/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { App1Component } from './app.component'; 4 | import {RouterModule, Routes} from '@angular/router'; 5 | import { FirstComponent } from './first/first.component'; 6 | import { environment as environmentParent } from '../../../../src/environments/environment'; 7 | import { StoreModule } from '@ngrx/store'; 8 | import { StoreDevtoolsModule } from '@ngrx/store-devtools'; 9 | import { environment } from '../environments/environment'; 10 | import {AdminLibModule} from '../../../admin-lib/src/lib/admin-lib.module'; 11 | import {showHideReducer} from './store/showHideElement/hide-show.reducer'; 12 | 13 | const routes: Routes = [ 14 | { path: '', component: FirstComponent } 15 | ]; 16 | 17 | 18 | @NgModule({ 19 | declarations: [ 20 | App1Component, 21 | FirstComponent 22 | ], 23 | imports: [ 24 | BrowserModule, 25 | AdminLibModule, 26 | RouterModule.forRoot(routes), 27 | StoreModule.forRoot({}), 28 | StoreModule.forFeature('app1ShowHide', showHideReducer), 29 | !environment.production ? StoreDevtoolsModule.instrument() : [] 30 | ], 31 | providers: [], 32 | bootstrap: [App1Component] 33 | }) 34 | export class AppModule { } 35 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rulesDirectory": [ 4 | "codelyzer" 5 | ], 6 | "rules": { 7 | "array-type": false, 8 | "arrow-parens": false, 9 | "deprecation": { 10 | "severity": "warn" 11 | }, 12 | "import-blacklist": [ 13 | true, 14 | "rxjs/Rx" 15 | ], 16 | "interface-name": false, 17 | "max-classes-per-file": false, 18 | "max-line-length": [ 19 | true, 20 | 140 21 | ], 22 | "member-access": false, 23 | "member-ordering": [ 24 | true, 25 | { 26 | "order": [ 27 | "static-field", 28 | "instance-field", 29 | "static-method", 30 | "instance-method" 31 | ] 32 | } 33 | ], 34 | "no-consecutive-blank-lines": false, 35 | "no-console": [ 36 | true, 37 | "debug", 38 | "info", 39 | "time", 40 | "timeEnd", 41 | "trace" 42 | ], 43 | "no-empty": false, 44 | "no-inferrable-types": [ 45 | true, 46 | "ignore-params" 47 | ], 48 | "no-non-null-assertion": true, 49 | "no-redundant-jsdoc": true, 50 | "no-switch-case-fall-through": true, 51 | "no-use-before-declare": true, 52 | "no-var-requires": false, 53 | "object-literal-key-quotes": [ 54 | true, 55 | "as-needed" 56 | ], 57 | "object-literal-sort-keys": false, 58 | "ordered-imports": false, 59 | "quotemark": [ 60 | true, 61 | "single" 62 | ], 63 | "trailing-comma": false, 64 | "no-output-on-prefix": true, 65 | "use-input-property-decorator": true, 66 | "use-output-property-decorator": true, 67 | "use-host-property-decorator": true, 68 | "no-input-rename": true, 69 | "no-output-rename": true, 70 | "use-life-cycle-interface": true, 71 | "use-pipe-transform-interface": true, 72 | "component-class-suffix": true, 73 | "directive-class-suffix": true 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "core-app", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start:Core": "ng serve --port 4444", 7 | "start:app1": "ng serve app1 --port 4422", 8 | "start:app2": "ng serve app2 --port 4423", 9 | "build:core": "ng build --prod --stats-json", 10 | "build:admin-lib": "ng build admin-lib", 11 | "build:app1": "ng build app1", 12 | "build:app2": "ng build app2", 13 | "test:core": "ng test", 14 | "test:app1": "ng test app1", 15 | "test:app2": "ng test app2", 16 | "lint:core": "ng lint", 17 | "lint:app1": "ng lint app1", 18 | "lint:app2": "ng lint app2", 19 | "e2e": "ng e2e" 20 | }, 21 | "private": true, 22 | "dependencies": { 23 | "@angular/animations": "~7.2.0", 24 | "@angular/common": "~7.2.0", 25 | "@angular/compiler": "~7.2.0", 26 | "@angular/core": "~7.2.0", 27 | "@angular/forms": "~7.2.0", 28 | "@angular/platform-browser": "~7.2.0", 29 | "@angular/platform-browser-dynamic": "~7.2.0", 30 | "@angular/router": "~7.2.0", 31 | "@ngrx/effects": "^7.3.0", 32 | "@ngrx/entity": "^7.3.0", 33 | "@ngrx/schematics": "^7.3.0", 34 | "@ngrx/store": "^7.3.0", 35 | "@ngrx/store-devtools": "^7.3.0", 36 | "core-js": "^2.5.4", 37 | "rxjs": "~6.3.3", 38 | "tslib": "^1.9.0", 39 | "zone.js": "~0.8.26" 40 | }, 41 | "devDependencies": { 42 | "@angular-devkit/build-angular": "~0.13.0", 43 | "@angular-devkit/build-ng-packagr": "~0.13.0", 44 | "@angular/cli": "~7.3.1", 45 | "@angular/compiler-cli": "~7.2.0", 46 | "@angular/language-service": "~7.2.0", 47 | "@types/node": "~8.9.4", 48 | "@types/jasmine": "~2.8.8", 49 | "@types/jasminewd2": "~2.0.3", 50 | "codelyzer": "~4.5.0", 51 | "jasmine-core": "~2.99.1", 52 | "jasmine-spec-reporter": "~4.2.1", 53 | "karma": "~3.1.1", 54 | "karma-chrome-launcher": "~2.2.0", 55 | "karma-coverage-istanbul-reporter": "~2.0.1", 56 | "karma-jasmine": "~1.1.2", 57 | "karma-jasmine-html-reporter": "^0.2.2", 58 | "ng-packagr": "^4.2.0", 59 | "protractor": "~5.4.0", 60 | "ts-node": "~7.0.0", 61 | "tsickle": ">=0.34.0", 62 | "tslib": "^1.9.0", 63 | "tslint": "~5.11.0", 64 | "typescript": "~3.2.2" 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CoreApp 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.3.1. 4 | 5 | ## Main project structure 6 | 7 | - You have one **CoreApp** 8 | * made with `ng new CoreApp`. 9 | 10 | 11 | - You have 2 sub-applications (app1 and app2) 12 | 13 | * `ng generate application app1` 14 | * `ng g application app2`) 15 | 16 | - You have library admin-lib 17 | 18 | * `ng g lib admin-lib` 19 | 20 | - **App1** and **App2** can be started and developed independently: 21 | * `npm run start:app1` and `npm run start:app2` 22 | * `npm run test:app1` and `npm run test:app2` 23 | * `npm run lint:app1` and `npm run lint:app2` 24 | * `npm run build:app1` and `npm run build:app2` 25 | 26 | - Each of **App1** and **App2** has its own _ngRx_ instance, so you can use _Redux-Dev-Tools_ to observe their Stores. 27 | 28 | - **admin-lib** is a components lib and can be build and used in any of apps (_CoreApp_, _app1_ and _app2_) 29 | 30 | - **CoreApp** includes **App1** and **App2** as lazy-loaded routing modules. 31 | * ngRx feature modules of both app1 and app2 are attached to CoreApp Store. 32 | * You can send actions from CoreApp to change App1 and App2 feature branches values. 33 | 34 | ## Implementation details 35 | 36 | Each of sub-application (app1 and app2) has: 37 | - **app.module.ts** - for independent development 38 | - **app.module-export.ts** - to be used when included in Core-App 39 | 40 | Mostly they should be identical except **app.module-export.ts** has such specifics: 41 | - **RouterModule.forRoot** is changed to **RouterModule.forChild** 42 | - **StoreModule.forRoot** is removed (but feature modules should stay) 43 | - **StoreDevtoolsModule** is removed as well (CoreApp has its own StoreDevtools module) 44 | 45 | ```Actually these two files has be easily merged to one (todo for the future), used modules can be attached and detached just by using some CoreApp environment.ts variable``` 46 | 47 | ## Installation notes: 48 | * Clone github repo 49 | * `npm install` OR `npm i` 50 | * `npm run build:admin-lib` 51 | * `npm run start:Core` (or any other command from package.json 'scripts' section) 52 | 53 | ## Animated demo 54 | 1. Project structure 55 | ![](CoreApp-project-structure.gif) 56 | 57 | 2. Starting **App1**, **App2** and **CoreApp** 58 | ![](CoreApp-start_apps_separately.gif) 59 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 22 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 23 | 24 | /** 25 | * Web Animations `@angular/platform-browser/animations` 26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 28 | */ 29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 30 | 31 | /** 32 | * By default, zone.js will patch all possible macroTask and DomEvents 33 | * user can disable parts of macroTask/DomEvents patch by setting following flags 34 | * because those flags need to be set before `zone.js` being loaded, and webpack 35 | * will put import in the top of bundle, so user need to create a separate file 36 | * in this directory (for example: zone-flags.ts), and put the following flags 37 | * into that file, and then add the following code before importing zone.js. 38 | * import './zone-flags.ts'; 39 | * 40 | * The flags allowed in zone-flags.ts are listed here. 41 | * 42 | * The following flags will work for all browsers. 43 | * 44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 46 | * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 47 | * 48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 50 | * 51 | * (window as any).__Zone_enable_cross_context_check = true; 52 | * 53 | */ 54 | 55 | /*************************************************************************************************** 56 | * Zone JS is required by default for Angular itself. 57 | */ 58 | import 'zone.js/dist/zone'; // Included with Angular CLI. 59 | 60 | 61 | /*************************************************************************************************** 62 | * APPLICATION IMPORTS 63 | */ 64 | -------------------------------------------------------------------------------- /projects/app1/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 22 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 23 | 24 | /** 25 | * Web Animations `@angular/platform-browser/animations` 26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 28 | */ 29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 30 | 31 | /** 32 | * By default, zone.js will patch all possible macroTask and DomEvents 33 | * user can disable parts of macroTask/DomEvents patch by setting following flags 34 | * because those flags need to be set before `zone.js` being loaded, and webpack 35 | * will put import in the top of bundle, so user need to create a separate file 36 | * in this directory (for example: zone-flags.ts), and put the following flags 37 | * into that file, and then add the following code before importing zone.js. 38 | * import './zone-flags.ts'; 39 | * 40 | * The flags allowed in zone-flags.ts are listed here. 41 | * 42 | * The following flags will work for all browsers. 43 | * 44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 46 | * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 47 | * 48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 50 | * 51 | * (window as any).__Zone_enable_cross_context_check = true; 52 | * 53 | */ 54 | 55 | /*************************************************************************************************** 56 | * Zone JS is required by default for Angular itself. 57 | */ 58 | import 'zone.js/dist/zone'; // Included with Angular CLI. 59 | 60 | 61 | /*************************************************************************************************** 62 | * APPLICATION IMPORTS 63 | */ 64 | -------------------------------------------------------------------------------- /projects/app2/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 22 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 23 | 24 | /** 25 | * Web Animations `@angular/platform-browser/animations` 26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 28 | */ 29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 30 | 31 | /** 32 | * By default, zone.js will patch all possible macroTask and DomEvents 33 | * user can disable parts of macroTask/DomEvents patch by setting following flags 34 | * because those flags need to be set before `zone.js` being loaded, and webpack 35 | * will put import in the top of bundle, so user need to create a separate file 36 | * in this directory (for example: zone-flags.ts), and put the following flags 37 | * into that file, and then add the following code before importing zone.js. 38 | * import './zone-flags.ts'; 39 | * 40 | * The flags allowed in zone-flags.ts are listed here. 41 | * 42 | * The following flags will work for all browsers. 43 | * 44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 46 | * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 47 | * 48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 50 | * 51 | * (window as any).__Zone_enable_cross_context_check = true; 52 | * 53 | */ 54 | 55 | /*************************************************************************************************** 56 | * Zone JS is required by default for Angular itself. 57 | */ 58 | import 'zone.js/dist/zone'; // Included with Angular CLI. 59 | 60 | 61 | /*************************************************************************************************** 62 | * APPLICATION IMPORTS 63 | */ 64 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "Core-App": { 7 | "root": "", 8 | "sourceRoot": "src", 9 | "projectType": "application", 10 | "prefix": "app", 11 | "schematics": { 12 | "@schematics/angular:component": { 13 | "style": "sass" 14 | } 15 | }, 16 | "architect": { 17 | "build": { 18 | "builder": "@angular-devkit/build-angular:browser", 19 | "options": { 20 | "outputPath": "dist/Core-App", 21 | "index": "src/index.html", 22 | "main": "src/main.ts", 23 | "polyfills": "src/polyfills.ts", 24 | "tsConfig": "src/tsconfig.app.json", 25 | "assets": [ 26 | "src/favicon.ico", 27 | "src/assets" 28 | ], 29 | "styles": [ 30 | "src/styles.scss" 31 | ], 32 | "scripts": [], 33 | "es5BrowserSupport": true 34 | }, 35 | "configurations": { 36 | "production": { 37 | "fileReplacements": [ 38 | { 39 | "replace": "src/environments/environment.ts", 40 | "with": "src/environments/environment.prod.ts" 41 | } 42 | ], 43 | "optimization": true, 44 | "outputHashing": "all", 45 | "sourceMap": false, 46 | "extractCss": true, 47 | "namedChunks": false, 48 | "aot": true, 49 | "extractLicenses": true, 50 | "vendorChunk": false, 51 | "buildOptimizer": true, 52 | "budgets": [ 53 | { 54 | "type": "initial", 55 | "maximumWarning": "2mb", 56 | "maximumError": "5mb" 57 | } 58 | ] 59 | } 60 | } 61 | }, 62 | "serve": { 63 | "builder": "@angular-devkit/build-angular:dev-server", 64 | "options": { 65 | "browserTarget": "Core-App:build" 66 | }, 67 | "configurations": { 68 | "production": { 69 | "browserTarget": "Core-App:build:production" 70 | } 71 | } 72 | }, 73 | "extract-i18n": { 74 | "builder": "@angular-devkit/build-angular:extract-i18n", 75 | "options": { 76 | "browserTarget": "Core-App:build" 77 | } 78 | }, 79 | "test": { 80 | "builder": "@angular-devkit/build-angular:karma", 81 | "options": { 82 | "main": "src/test.ts", 83 | "polyfills": "src/polyfills.ts", 84 | "tsConfig": "src/tsconfig.spec.json", 85 | "karmaConfig": "src/karma.conf.js", 86 | "styles": [ 87 | "src/styles.scss" 88 | ], 89 | "scripts": [], 90 | "assets": [ 91 | "src/favicon.ico", 92 | "src/assets" 93 | ] 94 | } 95 | }, 96 | "lint": { 97 | "builder": "@angular-devkit/build-angular:tslint", 98 | "options": { 99 | "tsConfig": [ 100 | "src/tsconfig.app.json", 101 | "src/tsconfig.spec.json" 102 | ], 103 | "exclude": [ 104 | "**/node_modules/**" 105 | ] 106 | } 107 | } 108 | } 109 | }, 110 | "Core-App-e2e": { 111 | "root": "e2e/", 112 | "projectType": "application", 113 | "prefix": "", 114 | "architect": { 115 | "e2e": { 116 | "builder": "@angular-devkit/build-angular:protractor", 117 | "options": { 118 | "protractorConfig": "e2e/protractor.conf.js", 119 | "devServerTarget": "Core-App:serve" 120 | }, 121 | "configurations": { 122 | "production": { 123 | "devServerTarget": "Core-App:serve:production" 124 | } 125 | } 126 | }, 127 | "lint": { 128 | "builder": "@angular-devkit/build-angular:tslint", 129 | "options": { 130 | "tsConfig": "e2e/tsconfig.e2e.json", 131 | "exclude": [ 132 | "**/node_modules/**" 133 | ] 134 | } 135 | } 136 | } 137 | }, 138 | "app1": { 139 | "root": "projects/app1/", 140 | "sourceRoot": "projects/app1/src", 141 | "projectType": "application", 142 | "prefix": "app", 143 | "schematics": {}, 144 | "architect": { 145 | "build": { 146 | "builder": "@angular-devkit/build-angular:browser", 147 | "options": { 148 | "outputPath": "dist/app1", 149 | "index": "projects/app1/src/index.html", 150 | "main": "projects/app1/src/main.ts", 151 | "polyfills": "projects/app1/src/polyfills.ts", 152 | "tsConfig": "projects/app1/tsconfig.app.json", 153 | "assets": [ 154 | "projects/app1/src/favicon.ico", 155 | "projects/app1/src/assets" 156 | ], 157 | "styles": [ 158 | "projects/app1/src/styles.css" 159 | ], 160 | "scripts": [], 161 | "es5BrowserSupport": true 162 | }, 163 | "configurations": { 164 | "production": { 165 | "fileReplacements": [ 166 | { 167 | "replace": "projects/app1/src/environments/environment.ts", 168 | "with": "projects/app1/src/environments/environment.prod.ts" 169 | } 170 | ], 171 | "optimization": true, 172 | "outputHashing": "all", 173 | "sourceMap": false, 174 | "extractCss": true, 175 | "namedChunks": false, 176 | "aot": true, 177 | "extractLicenses": true, 178 | "vendorChunk": false, 179 | "buildOptimizer": true, 180 | "budgets": [ 181 | { 182 | "type": "initial", 183 | "maximumWarning": "2mb", 184 | "maximumError": "5mb" 185 | } 186 | ] 187 | } 188 | } 189 | }, 190 | "serve": { 191 | "builder": "@angular-devkit/build-angular:dev-server", 192 | "options": { 193 | "browserTarget": "app1:build" 194 | }, 195 | "configurations": { 196 | "production": { 197 | "browserTarget": "app1:build:production" 198 | } 199 | } 200 | }, 201 | "extract-i18n": { 202 | "builder": "@angular-devkit/build-angular:extract-i18n", 203 | "options": { 204 | "browserTarget": "app1:build" 205 | } 206 | }, 207 | "test": { 208 | "builder": "@angular-devkit/build-angular:karma", 209 | "options": { 210 | "main": "projects/app1/src/test.ts", 211 | "polyfills": "projects/app1/src/polyfills.ts", 212 | "tsConfig": "projects/app1/tsconfig.spec.json", 213 | "karmaConfig": "projects/app1/karma.conf.js", 214 | "styles": [ 215 | "projects/app1/src/styles.css" 216 | ], 217 | "scripts": [], 218 | "assets": [ 219 | "projects/app1/src/favicon.ico", 220 | "projects/app1/src/assets" 221 | ] 222 | } 223 | }, 224 | "lint": { 225 | "builder": "@angular-devkit/build-angular:tslint", 226 | "options": { 227 | "tsConfig": [ 228 | "projects/app1/tsconfig.app.json", 229 | "projects/app1/tsconfig.spec.json" 230 | ], 231 | "exclude": [ 232 | "**/node_modules/**" 233 | ] 234 | } 235 | } 236 | } 237 | }, 238 | "app1-e2e": { 239 | "root": "projects/app1-e2e/", 240 | "projectType": "application", 241 | "prefix": "", 242 | "architect": { 243 | "e2e": { 244 | "builder": "@angular-devkit/build-angular:protractor", 245 | "options": { 246 | "protractorConfig": "projects/app1-e2e/protractor.conf.js", 247 | "devServerTarget": "app1:serve" 248 | }, 249 | "configurations": { 250 | "production": { 251 | "devServerTarget": "app1:serve:production" 252 | } 253 | } 254 | }, 255 | "lint": { 256 | "builder": "@angular-devkit/build-angular:tslint", 257 | "options": { 258 | "tsConfig": "projects/app1-e2e/tsconfig.e2e.json", 259 | "exclude": [ 260 | "**/node_modules/**" 261 | ] 262 | } 263 | } 264 | } 265 | }, 266 | "app2": { 267 | "root": "projects/app2/", 268 | "sourceRoot": "projects/app2/src", 269 | "projectType": "application", 270 | "prefix": "app", 271 | "schematics": {}, 272 | "architect": { 273 | "build": { 274 | "builder": "@angular-devkit/build-angular:browser", 275 | "options": { 276 | "outputPath": "dist/app2", 277 | "index": "projects/app2/src/index.html", 278 | "main": "projects/app2/src/main.ts", 279 | "polyfills": "projects/app2/src/polyfills.ts", 280 | "tsConfig": "projects/app2/tsconfig.app.json", 281 | "assets": [ 282 | "projects/app2/src/favicon.ico", 283 | "projects/app2/src/assets" 284 | ], 285 | "styles": [ 286 | "projects/app2/src/styles.css" 287 | ], 288 | "scripts": [], 289 | "es5BrowserSupport": true 290 | }, 291 | "configurations": { 292 | "production": { 293 | "fileReplacements": [ 294 | { 295 | "replace": "projects/app2/src/environments/environment.ts", 296 | "with": "projects/app2/src/environments/environment.prod.ts" 297 | } 298 | ], 299 | "optimization": true, 300 | "outputHashing": "all", 301 | "sourceMap": false, 302 | "extractCss": true, 303 | "namedChunks": false, 304 | "aot": true, 305 | "extractLicenses": true, 306 | "vendorChunk": false, 307 | "buildOptimizer": true, 308 | "budgets": [ 309 | { 310 | "type": "initial", 311 | "maximumWarning": "2mb", 312 | "maximumError": "5mb" 313 | } 314 | ] 315 | } 316 | } 317 | }, 318 | "serve": { 319 | "builder": "@angular-devkit/build-angular:dev-server", 320 | "options": { 321 | "browserTarget": "app2:build" 322 | }, 323 | "configurations": { 324 | "production": { 325 | "browserTarget": "app2:build:production" 326 | } 327 | } 328 | }, 329 | "extract-i18n": { 330 | "builder": "@angular-devkit/build-angular:extract-i18n", 331 | "options": { 332 | "browserTarget": "app2:build" 333 | } 334 | }, 335 | "test": { 336 | "builder": "@angular-devkit/build-angular:karma", 337 | "options": { 338 | "main": "projects/app2/src/test.ts", 339 | "polyfills": "projects/app2/src/polyfills.ts", 340 | "tsConfig": "projects/app2/tsconfig.spec.json", 341 | "karmaConfig": "projects/app2/karma.conf.js", 342 | "styles": [ 343 | "projects/app2/src/styles.css" 344 | ], 345 | "scripts": [], 346 | "assets": [ 347 | "projects/app2/src/favicon.ico", 348 | "projects/app2/src/assets" 349 | ] 350 | } 351 | }, 352 | "lint": { 353 | "builder": "@angular-devkit/build-angular:tslint", 354 | "options": { 355 | "tsConfig": [ 356 | "projects/app2/tsconfig.app.json", 357 | "projects/app2/tsconfig.spec.json" 358 | ], 359 | "exclude": [ 360 | "**/node_modules/**" 361 | ] 362 | } 363 | } 364 | } 365 | }, 366 | "app2-e2e": { 367 | "root": "projects/app2-e2e/", 368 | "projectType": "application", 369 | "prefix": "", 370 | "architect": { 371 | "e2e": { 372 | "builder": "@angular-devkit/build-angular:protractor", 373 | "options": { 374 | "protractorConfig": "projects/app2-e2e/protractor.conf.js", 375 | "devServerTarget": "app2:serve" 376 | }, 377 | "configurations": { 378 | "production": { 379 | "devServerTarget": "app2:serve:production" 380 | } 381 | } 382 | }, 383 | "lint": { 384 | "builder": "@angular-devkit/build-angular:tslint", 385 | "options": { 386 | "tsConfig": "projects/app2-e2e/tsconfig.e2e.json", 387 | "exclude": [ 388 | "**/node_modules/**" 389 | ] 390 | } 391 | } 392 | } 393 | }, 394 | "admin-lib": { 395 | "root": "projects/admin-lib", 396 | "sourceRoot": "projects/admin-lib/src", 397 | "projectType": "library", 398 | "prefix": "lib", 399 | "architect": { 400 | "build": { 401 | "builder": "@angular-devkit/build-ng-packagr:build", 402 | "options": { 403 | "tsConfig": "projects/admin-lib/tsconfig.lib.json", 404 | "project": "projects/admin-lib/ng-package.json" 405 | } 406 | }, 407 | "test": { 408 | "builder": "@angular-devkit/build-angular:karma", 409 | "options": { 410 | "main": "projects/admin-lib/src/test.ts", 411 | "tsConfig": "projects/admin-lib/tsconfig.spec.json", 412 | "karmaConfig": "projects/admin-lib/karma.conf.js" 413 | } 414 | }, 415 | "lint": { 416 | "builder": "@angular-devkit/build-angular:tslint", 417 | "options": { 418 | "tsConfig": [ 419 | "projects/admin-lib/tsconfig.lib.json", 420 | "projects/admin-lib/tsconfig.spec.json" 421 | ], 422 | "exclude": [ 423 | "**/node_modules/**" 424 | ] 425 | } 426 | } 427 | } 428 | } 429 | }, 430 | "defaultProject": "Core-App" 431 | } --------------------------------------------------------------------------------