├── .surgeignore
├── apps
├── app1
│ ├── src
│ │ ├── assets
│ │ │ └── .gitkeep
│ │ ├── app
│ │ │ ├── app.component.css
│ │ │ ├── app.component.html
│ │ │ ├── app.component.ts
│ │ │ ├── app.module.ts
│ │ │ └── app.component.spec.ts
│ │ ├── styles.css
│ │ ├── environments
│ │ │ ├── environment.prod.ts
│ │ │ └── environment.ts
│ │ ├── favicon.ico
│ │ ├── typings.d.ts
│ │ ├── tsconfig.app.json
│ │ ├── tsconfig.spec.json
│ │ ├── index.html
│ │ ├── main.ts
│ │ ├── test.ts
│ │ └── polyfills.ts
│ ├── e2e
│ │ ├── app.po.ts
│ │ ├── tsconfig.e2e.json
│ │ └── app.e2e-spec.ts
│ ├── .editorconfig
│ ├── tsconfig.json
│ ├── .gitignore
│ ├── protractor.conf.js
│ ├── README.md
│ ├── karma.conf.js
│ ├── .angular-cli.json
│ ├── package.json
│ └── tslint.json
├── help
│ ├── src
│ │ ├── assets
│ │ │ └── .gitkeep
│ │ ├── environments
│ │ │ ├── environment.prod.ts
│ │ │ └── environment.ts
│ │ ├── app
│ │ │ ├── app.component.scss
│ │ │ ├── app.component.ts
│ │ │ ├── app.module.ts
│ │ │ ├── app.component.spec.ts
│ │ │ └── app.component.html
│ │ ├── favicon.ico
│ │ ├── typings.d.ts
│ │ ├── styles.css
│ │ ├── tsconfig.app.json
│ │ ├── tsconfig.spec.json
│ │ ├── index.html
│ │ ├── main.ts
│ │ ├── test.ts
│ │ └── polyfills.ts
│ ├── e2e
│ │ ├── app.po.ts
│ │ ├── tsconfig.e2e.json
│ │ └── app.e2e-spec.ts
│ ├── .editorconfig
│ ├── tsconfig.json
│ ├── .gitignore
│ ├── protractor.conf.js
│ ├── README.md
│ ├── karma.conf.js
│ ├── .angular-cli.json
│ ├── package.json
│ └── tslint.json
├── home
│ ├── src
│ │ ├── assets
│ │ │ ├── .gitkeep
│ │ │ ├── angular-logo.png
│ │ │ └── toulouse-france.jpg
│ │ ├── app
│ │ │ ├── route1
│ │ │ │ ├── route1.component.css
│ │ │ │ ├── route1.component.html
│ │ │ │ ├── route1.component.ts
│ │ │ │ └── route1.component.spec.ts
│ │ │ ├── route2module
│ │ │ │ ├── route2.component.css
│ │ │ │ ├── route2.component.html
│ │ │ │ ├── route2.component.ts
│ │ │ │ ├── route2-routing.module.ts
│ │ │ │ ├── route2.module.ts
│ │ │ │ └── route2.component.spec.ts
│ │ │ ├── app.component.css
│ │ │ ├── app.module.ts
│ │ │ ├── app.component.spec.ts
│ │ │ ├── app.component.html
│ │ │ ├── app-routing.module.ts
│ │ │ └── app.component.ts
│ │ ├── environments
│ │ │ ├── environment.prod.ts
│ │ │ └── environment.ts
│ │ ├── favicon.ico
│ │ ├── typings.d.ts
│ │ ├── styles.css
│ │ ├── tsconfig.app.json
│ │ ├── tsconfig.spec.json
│ │ ├── index.html
│ │ ├── main.ts
│ │ ├── test.ts
│ │ └── polyfills.ts
│ ├── .editorconfig
│ ├── tsconfig.json
│ ├── .gitignore
│ ├── protractor.conf.js
│ ├── karma.conf.js
│ ├── README.md
│ ├── .angular-cli.json
│ ├── package.json
│ └── tslint.json
└── menu
│ ├── src
│ ├── assets
│ │ └── .gitkeep
│ ├── environments
│ │ ├── environment.prod.ts
│ │ └── environment.ts
│ ├── favicon.ico
│ ├── typings.d.ts
│ ├── styles.scss
│ ├── tsconfig.app.json
│ ├── app
│ │ ├── app.component.scss
│ │ ├── app.component.html
│ │ ├── app.component.spec.ts
│ │ ├── app.module.ts
│ │ └── app.component.ts
│ ├── tsconfig.spec.json
│ ├── index.html
│ ├── main.ts
│ ├── test.ts
│ └── polyfills.ts
│ ├── e2e
│ ├── app.po.ts
│ ├── tsconfig.e2e.json
│ └── app.e2e-spec.ts
│ ├── .editorconfig
│ ├── tsconfig.json
│ ├── .gitignore
│ ├── protractor.conf.js
│ ├── README.md
│ ├── karma.conf.js
│ ├── .angular-cli.json
│ ├── package.json
│ └── tslint.json
├── CNAME
├── shared
└── notifications
│ └── notification.service.ts
├── .gitignore
├── index.html
├── .babelrc
├── portal
├── main.css
├── applications.config.json
└── main.js
├── LICENSE
├── package.json
├── webpack.config.js
└── README.md
/.surgeignore:
--------------------------------------------------------------------------------
1 | bin
2 | src
3 |
--------------------------------------------------------------------------------
/apps/app1/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/help/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/home/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/menu/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/app1/src/app/app.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/CNAME:
--------------------------------------------------------------------------------
1 | single-spa-angular-cli.placeme.io
2 |
--------------------------------------------------------------------------------
/apps/home/src/app/route1/route1.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/shared/notifications/notification.service.ts:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/home/src/app/route2module/route2.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/app1/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 | Welcome to {{ title }}!
3 |
--------------------------------------------------------------------------------
/apps/home/src/app/route1/route1.component.html:
--------------------------------------------------------------------------------
1 |
2 | route1 works!
3 |
4 |
--------------------------------------------------------------------------------
/apps/home/src/app/app.component.css:
--------------------------------------------------------------------------------
1 | .header-image {
2 | background-size: cover;
3 | }
--------------------------------------------------------------------------------
/apps/app1/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
--------------------------------------------------------------------------------
/apps/home/src/app/route2module/route2.component.html:
--------------------------------------------------------------------------------
1 |
2 | Module for route2 is loaded!
3 |
4 |
--------------------------------------------------------------------------------
/apps/app1/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/apps/help/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/apps/home/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/apps/menu/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/apps/help/src/app/app.component.scss:
--------------------------------------------------------------------------------
1 | mat-card {
2 | height: calc(100% - 48px);
3 | width: calc(100% - 48px);
4 | }
--------------------------------------------------------------------------------
/apps/app1/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlaceMe-SAS/single-spa-angular-cli-examples/HEAD/apps/app1/src/favicon.ico
--------------------------------------------------------------------------------
/apps/help/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlaceMe-SAS/single-spa-angular-cli-examples/HEAD/apps/help/src/favicon.ico
--------------------------------------------------------------------------------
/apps/home/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlaceMe-SAS/single-spa-angular-cli-examples/HEAD/apps/home/src/favicon.ico
--------------------------------------------------------------------------------
/apps/menu/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlaceMe-SAS/single-spa-angular-cli-examples/HEAD/apps/menu/src/favicon.ico
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | bower_components/
3 | jspm_packages/
4 | .DS_Store
5 | npm-debug.log
6 | *.bundle.js
7 | *.bundle.js.map
8 | build/
9 | .idea
--------------------------------------------------------------------------------
/apps/app1/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | /* SystemJS module definition */
2 | declare var module: NodeModule;
3 | interface NodeModule {
4 | id: string;
5 | }
6 |
--------------------------------------------------------------------------------
/apps/help/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | /* SystemJS module definition */
2 | declare var module: NodeModule;
3 | interface NodeModule {
4 | id: string;
5 | }
6 |
--------------------------------------------------------------------------------
/apps/home/src/assets/angular-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlaceMe-SAS/single-spa-angular-cli-examples/HEAD/apps/home/src/assets/angular-logo.png
--------------------------------------------------------------------------------
/apps/home/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | /* SystemJS module definition */
2 | declare var module: NodeModule;
3 | interface NodeModule {
4 | id: string;
5 | }
6 |
--------------------------------------------------------------------------------
/apps/menu/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | /* SystemJS module definition */
2 | declare var module: NodeModule;
3 | interface NodeModule {
4 | id: string;
5 | }
6 |
--------------------------------------------------------------------------------
/apps/home/src/assets/toulouse-france.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlaceMe-SAS/single-spa-angular-cli-examples/HEAD/apps/home/src/assets/toulouse-france.jpg
--------------------------------------------------------------------------------
/apps/help/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
3 | html,
4 | body {
5 | margin: 0;
6 | padding: 0;
7 | height: 100%;
8 | width: 100%;
9 | }
--------------------------------------------------------------------------------
/apps/home/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 | @import "~@angular/material/prebuilt-themes/indigo-pink.css";
3 | @import url('https://fonts.googleapis.com/icon?family=Material+Icons');
--------------------------------------------------------------------------------
/apps/menu/src/styles.scss:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 | @import "~@angular/material/prebuilt-themes/indigo-pink.css";
3 | @import url('https://fonts.googleapis.com/icon?family=Material+Icons');
4 |
--------------------------------------------------------------------------------
/apps/app1/e2e/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class AppPage {
4 | navigateTo() {
5 | return browser.get('/');
6 | }
7 |
8 | getParagraphText() {
9 | return element(by.css('app1-root h1')).getText();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/apps/help/e2e/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class AppPage {
4 | navigateTo() {
5 | return browser.get('/');
6 | }
7 |
8 | getParagraphText() {
9 | return element(by.css('help-root h1')).getText();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/apps/menu/e2e/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class AppPage {
4 | navigateTo() {
5 | return browser.get('/');
6 | }
7 |
8 | getParagraphText() {
9 | return element(by.css('menu-root h1')).getText();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/apps/app1/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app1-root',
5 | templateUrl: './app.component.html',
6 | styleUrls: ['./app.component.css']
7 | })
8 | export class AppComponent {
9 | title = 'app1';
10 | }
11 |
--------------------------------------------------------------------------------
/apps/menu/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "baseUrl": "./",
6 | "module": "es2015",
7 | "types": []
8 | },
9 | "exclude": [
10 | "test.ts",
11 | "**/*.spec.ts"
12 | ]
13 | }
--------------------------------------------------------------------------------
/apps/app1/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "baseUrl": "./",
6 | "module": "es2015",
7 | "types": []
8 | },
9 | "exclude": [
10 | "test.ts",
11 | "**/*.spec.ts"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/apps/help/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "baseUrl": "./",
6 | "module": "es2015",
7 | "types": []
8 | },
9 | "exclude": [
10 | "test.ts",
11 | "**/*.spec.ts"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/apps/home/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "baseUrl": "./",
6 | "module": "es2015",
7 | "types": []
8 | },
9 | "exclude": [
10 | "test.ts",
11 | "**/*.spec.ts"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/apps/menu/src/app/app.component.scss:
--------------------------------------------------------------------------------
1 | mat-toolbar {
2 | .spacer {
3 | flex: 1 1 auto;
4 | }
5 |
6 | a {
7 | color: white;
8 | padding: 0 1rem;
9 | height: 2rem;
10 | }
11 |
12 | mat-icon {
13 | font-size: 2rem;
14 | }
15 | }
--------------------------------------------------------------------------------
/apps/app1/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see http://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 |
--------------------------------------------------------------------------------
/apps/app1/e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/e2e",
5 | "baseUrl": "./",
6 | "module": "commonjs",
7 | "target": "es5",
8 | "types": [
9 | "jasmine",
10 | "jasminewd2",
11 | "node"
12 | ]
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/apps/help/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see http://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 |
--------------------------------------------------------------------------------
/apps/help/e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/e2e",
5 | "baseUrl": "./",
6 | "module": "commonjs",
7 | "target": "es5",
8 | "types": [
9 | "jasmine",
10 | "jasminewd2",
11 | "node"
12 | ]
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/apps/home/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see http://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 |
--------------------------------------------------------------------------------
/apps/menu/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see http://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 |
--------------------------------------------------------------------------------
/apps/menu/e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/e2e",
5 | "baseUrl": "./",
6 | "module": "commonjs",
7 | "target": "es5",
8 | "types": [
9 | "jasmine",
10 | "jasminewd2",
11 | "node"
12 | ]
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Single SPA - Angular CLI Examples
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | presets: [
3 | 'react',
4 | ['babel-preset-env', {
5 | targets: {
6 | "browsers": ["last 2 versions"],
7 | },
8 | }],
9 | ],
10 | plugins: [
11 | 'transform-object-rest-spread',
12 | 'transform-class-properties',
13 | 'syntax-dynamic-import',
14 | 'transform-function-bind',
15 | ],
16 | }
17 |
--------------------------------------------------------------------------------
/apps/app1/e2e/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 |
3 | describe('app1 App', () => {
4 | let page: AppPage;
5 |
6 | beforeEach(() => {
7 | page = new AppPage();
8 | });
9 |
10 | it('should display welcome message', () => {
11 | page.navigateTo();
12 | expect(page.getParagraphText()).toEqual('Welcome to app1!');
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/apps/help/e2e/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 |
3 | describe('help App', () => {
4 | let page: AppPage;
5 |
6 | beforeEach(() => {
7 | page = new AppPage();
8 | });
9 |
10 | it('should display welcome message', () => {
11 | page.navigateTo();
12 | expect(page.getParagraphText()).toEqual('Welcome to help!');
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/apps/menu/e2e/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 |
3 | describe('menu App', () => {
4 | let page: AppPage;
5 |
6 | beforeEach(() => {
7 | page = new AppPage();
8 | });
9 |
10 | it('should display welcome message', () => {
11 | page.navigateTo();
12 | expect(page.getParagraphText()).toEqual('Welcome to menu!');
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/apps/home/src/app/route1/route1.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'home-route1',
5 | templateUrl: './route1.component.html',
6 | styleUrls: ['./route1.component.css']
7 | })
8 | export class Route1Component implements OnInit {
9 |
10 | constructor() { }
11 |
12 | ngOnInit() {
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/apps/home/src/app/route2module/route2.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'home-route2',
5 | templateUrl: './route2.component.html',
6 | styleUrls: ['./route2.component.css']
7 | })
8 | export class Route2Component implements OnInit {
9 |
10 | constructor() { }
11 |
12 | ngOnInit() {
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/portal/main.css:
--------------------------------------------------------------------------------
1 | menu-root {
2 | position: absolute;
3 | top: 0;
4 | left: 0;
5 | right: 0;
6 | height: 60px;
7 | }
8 |
9 | home-root,
10 | app1-root {
11 | margin-top: 70px;
12 | display: block;
13 | }
14 |
15 | help-root {
16 | position: absolute;
17 | top: 64px;
18 | right: 0;
19 | bottom: 0;
20 | width: 50%;
21 | min-width: 350px;
22 | max-width: 800px;
23 | }
--------------------------------------------------------------------------------
/apps/app1/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { BrowserModule } from '@angular/platform-browser';
2 | import { NgModule } from '@angular/core';
3 |
4 |
5 | import { AppComponent } from './app.component';
6 |
7 |
8 | @NgModule({
9 | declarations: [
10 | AppComponent
11 | ],
12 | imports: [
13 | BrowserModule
14 | ],
15 | providers: [],
16 | bootstrap: [AppComponent]
17 | })
18 | export class AppModule { }
19 |
--------------------------------------------------------------------------------
/apps/app1/src/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/spec",
5 | "baseUrl": "./",
6 | "module": "commonjs",
7 | "target": "es5",
8 | "types": [
9 | "jasmine",
10 | "node"
11 | ]
12 | },
13 | "files": [
14 | "test.ts"
15 | ],
16 | "include": [
17 | "**/*.spec.ts",
18 | "**/*.d.ts"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/apps/help/src/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/spec",
5 | "baseUrl": "./",
6 | "module": "commonjs",
7 | "target": "es5",
8 | "types": [
9 | "jasmine",
10 | "node"
11 | ]
12 | },
13 | "files": [
14 | "test.ts"
15 | ],
16 | "include": [
17 | "**/*.spec.ts",
18 | "**/*.d.ts"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/apps/home/src/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/spec",
5 | "baseUrl": "./",
6 | "module": "commonjs",
7 | "target": "es5",
8 | "types": [
9 | "jasmine",
10 | "node"
11 | ]
12 | },
13 | "files": [
14 | "test.ts"
15 | ],
16 | "include": [
17 | "**/*.spec.ts",
18 | "**/*.d.ts"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/apps/menu/src/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/spec",
5 | "baseUrl": "./",
6 | "module": "commonjs",
7 | "target": "es5",
8 | "types": [
9 | "jasmine",
10 | "node"
11 | ]
12 | },
13 | "files": [
14 | "test.ts"
15 | ],
16 | "include": [
17 | "**/*.spec.ts",
18 | "**/*.d.ts"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/apps/help/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | declare const location: any;
4 |
5 | @Component({
6 | selector: 'help-root',
7 | templateUrl: './app.component.html',
8 | styleUrls: ['./app.component.scss']
9 | })
10 | export class AppComponent implements OnInit {
11 |
12 | url: string;
13 |
14 | ngOnInit(): void {
15 | this.url = location.pathname;
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/apps/app1/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // The file contents for the current environment will overwrite these during build.
2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do
3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead.
4 | // The list of which env maps to which file can be found in `.angular-cli.json`.
5 |
6 | export const environment = {
7 | production: false
8 | };
9 |
--------------------------------------------------------------------------------
/apps/help/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // The file contents for the current environment will overwrite these during build.
2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do
3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead.
4 | // The list of which env maps to which file can be found in `.angular-cli.json`.
5 |
6 | export const environment = {
7 | production: false
8 | };
9 |
--------------------------------------------------------------------------------
/apps/home/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // The file contents for the current environment will overwrite these during build.
2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do
3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead.
4 | // The list of which env maps to which file can be found in `.angular-cli.json`.
5 |
6 | export const environment = {
7 | production: false
8 | };
9 |
--------------------------------------------------------------------------------
/apps/menu/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // The file contents for the current environment will overwrite these during build.
2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do
3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead.
4 | // The list of which env maps to which file can be found in `.angular-cli.json`.
5 |
6 | export const environment = {
7 | production: false
8 | };
9 |
--------------------------------------------------------------------------------
/apps/menu/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "outDir": "./dist/out-tsc",
5 | "sourceMap": true,
6 | "declaration": false,
7 | "moduleResolution": "node",
8 | "emitDecoratorMetadata": true,
9 | "experimentalDecorators": true,
10 | "target": "es5",
11 | "typeRoots": [
12 | "node_modules/@types"
13 | ],
14 | "lib": [
15 | "es2017",
16 | "dom"
17 | ]
18 | }
19 | }
--------------------------------------------------------------------------------
/apps/app1/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | App1
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/apps/app1/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "outDir": "./dist/out-tsc",
5 | "sourceMap": true,
6 | "declaration": false,
7 | "moduleResolution": "node",
8 | "emitDecoratorMetadata": true,
9 | "experimentalDecorators": true,
10 | "target": "es5",
11 | "typeRoots": [
12 | "node_modules/@types"
13 | ],
14 | "lib": [
15 | "es2017",
16 | "dom"
17 | ]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/apps/help/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Help
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/apps/help/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "outDir": "./dist/out-tsc",
5 | "sourceMap": true,
6 | "declaration": false,
7 | "moduleResolution": "node",
8 | "emitDecoratorMetadata": true,
9 | "experimentalDecorators": true,
10 | "target": "es5",
11 | "typeRoots": [
12 | "node_modules/@types"
13 | ],
14 | "lib": [
15 | "es2017",
16 | "dom"
17 | ]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/apps/home/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Home
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/apps/home/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "outDir": "./dist/out-tsc",
5 | "sourceMap": true,
6 | "declaration": false,
7 | "moduleResolution": "node",
8 | "emitDecoratorMetadata": true,
9 | "experimentalDecorators": true,
10 | "target": "es5",
11 | "typeRoots": [
12 | "node_modules/@types"
13 | ],
14 | "lib": [
15 | "es2017",
16 | "dom"
17 | ]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/apps/menu/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Menu
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/apps/menu/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Portal
4 |
5 |
6 |
7 | home
8 |
9 |
10 | dashboard
11 |
12 |
13 | help_outline
14 |
15 |
--------------------------------------------------------------------------------
/apps/home/src/app/route2module/route2-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { RouterModule, Routes } from '@angular/router';
3 |
4 | import { Route2Component } from './route2.component';
5 |
6 | const routes: Routes = [
7 | { path: '', component: Route2Component }
8 | ];
9 |
10 | @NgModule({
11 | declarations: [Route2Component],
12 | imports: [RouterModule.forChild(routes)],
13 | exports: [RouterModule]
14 | })
15 | export class Route2RoutingModule { }
16 |
--------------------------------------------------------------------------------
/apps/home/src/app/route2module/route2.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { BrowserModule } from '@angular/platform-browser';
3 |
4 | import { Route2RoutingModule } from './route2-routing.module';
5 | import { Route2Component } from './route2.component';
6 |
7 | @NgModule({
8 | imports: [
9 | BrowserModule,
10 | Route2RoutingModule
11 | ],
12 | declarations: [
13 |
14 | ],
15 | entryComponents: [Route2Component],
16 | exports: []
17 | })
18 | export class Route2Module { }
19 |
--------------------------------------------------------------------------------
/apps/help/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { BrowserModule } from '@angular/platform-browser';
2 | import { NgModule } from '@angular/core';
3 | import { MatCardModule, MatExpansionModule } from '@angular/material';
4 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
5 |
6 | import { AppComponent } from './app.component';
7 |
8 | @NgModule({
9 | declarations: [
10 | AppComponent
11 | ],
12 | imports: [
13 | BrowserModule,
14 | BrowserAnimationsModule,
15 | MatCardModule,
16 | MatExpansionModule
17 | ],
18 | providers: [],
19 | bootstrap: [AppComponent]
20 | })
21 | export class AppModule { }
22 |
--------------------------------------------------------------------------------
/apps/help/src/app/app.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed, async } from '@angular/core/testing';
2 | import { NO_ERRORS_SCHEMA } from '@angular/core';
3 |
4 | import { AppComponent } from './app.component';
5 |
6 | describe('AppComponent', () => {
7 | beforeEach(async(() => {
8 | TestBed.configureTestingModule({
9 | declarations: [
10 | AppComponent
11 | ],
12 | schemas: [NO_ERRORS_SCHEMA]
13 | }).compileComponents();
14 | }));
15 | it('should create the app', async(() => {
16 | const fixture = TestBed.createComponent(AppComponent);
17 | const app = fixture.debugElement.componentInstance;
18 | expect(app).toBeTruthy();
19 | }));
20 | });
21 |
--------------------------------------------------------------------------------
/portal/applications.config.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name": "menu",
4 | "selector": "menu-root",
5 | "baseHref": "/menu",
6 | "matchRoute": "/**"
7 | },
8 | {
9 | "name": "home",
10 | "selector": "home-root",
11 | "baseHref": "/home",
12 | "matchRoute": "/home/",
13 | "isDefaultApp": true
14 | },
15 | {
16 | "name": "app1",
17 | "selector": "app1-root",
18 | "baseHref": "/app1",
19 | "matchRoute": "/app1/"
20 | },
21 | {
22 | "name": "help",
23 | "selector": "help-root",
24 | "baseHref": "/help",
25 | "matchRoute": "help=open"
26 | }
27 | ]
--------------------------------------------------------------------------------
/apps/app1/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 | import { platformSingleSpa } from 'single-spa-angular-cli';
4 |
5 | import { AppModule } from './app/app.module';
6 | import { environment } from './environments/environment';
7 |
8 | if (environment.production) {
9 | enableProdMode();
10 | }
11 |
12 | platformSingleSpa.mount('app1').subscribe(({ props, attachUnmount }) => {
13 | platformBrowserDynamic().bootstrapModule(AppModule).then((module) => {
14 | attachUnmount(module);
15 | // Do something with props if you want
16 | // Ex : module.instance.setSomething(...)
17 | });
18 | });
19 |
--------------------------------------------------------------------------------
/apps/help/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 | import { platformSingleSpa } from 'single-spa-angular-cli';
4 |
5 | import { AppModule } from './app/app.module';
6 | import { environment } from './environments/environment';
7 |
8 | if (environment.production) {
9 | enableProdMode();
10 | }
11 |
12 | platformSingleSpa.mount('help').subscribe(({ props, attachUnmount }) => {
13 | platformBrowserDynamic().bootstrapModule(AppModule).then((module) => {
14 | attachUnmount(module);
15 | // Do something with props if you want
16 | // Ex : module.instance.setSomething(...)
17 | });
18 | });
19 |
--------------------------------------------------------------------------------
/apps/menu/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 | import { platformSingleSpa } from 'single-spa-angular-cli';
4 |
5 | import { AppModule } from './app/app.module';
6 | import { environment } from './environments/environment';
7 |
8 | if (environment.production) {
9 | enableProdMode();
10 | }
11 |
12 | platformSingleSpa.mount('menu').subscribe(({ props, attachUnmount }) => {
13 | platformBrowserDynamic().bootstrapModule(AppModule).then((module) => {
14 | attachUnmount(module);
15 | // Do something with props if you want
16 | // Ex : module.instance.setSomething(...)
17 | });
18 | });
19 |
--------------------------------------------------------------------------------
/apps/app1/.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 | # IDEs and editors
12 | /.idea
13 | .project
14 | .classpath
15 | .c9/
16 | *.launch
17 | .settings/
18 | *.sublime-workspace
19 |
20 | # IDE - VSCode
21 | .vscode/*
22 | !.vscode/settings.json
23 | !.vscode/tasks.json
24 | !.vscode/launch.json
25 | !.vscode/extensions.json
26 |
27 | # misc
28 | /.sass-cache
29 | /connect.lock
30 | /coverage
31 | /libpeerconnection.log
32 | npm-debug.log
33 | testem.log
34 | /typings
35 |
36 | # e2e
37 | /e2e/*.js
38 | /e2e/*.map
39 |
40 | # System Files
41 | .DS_Store
42 | Thumbs.db
43 |
--------------------------------------------------------------------------------
/apps/help/.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 | # IDEs and editors
12 | /.idea
13 | .project
14 | .classpath
15 | .c9/
16 | *.launch
17 | .settings/
18 | *.sublime-workspace
19 |
20 | # IDE - VSCode
21 | .vscode/*
22 | !.vscode/settings.json
23 | !.vscode/tasks.json
24 | !.vscode/launch.json
25 | !.vscode/extensions.json
26 |
27 | # misc
28 | /.sass-cache
29 | /connect.lock
30 | /coverage
31 | /libpeerconnection.log
32 | npm-debug.log
33 | testem.log
34 | /typings
35 |
36 | # e2e
37 | /e2e/*.js
38 | /e2e/*.map
39 |
40 | # System Files
41 | .DS_Store
42 | Thumbs.db
43 |
--------------------------------------------------------------------------------
/apps/home/.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 | # IDEs and editors
12 | /.idea
13 | .project
14 | .classpath
15 | .c9/
16 | *.launch
17 | .settings/
18 | *.sublime-workspace
19 |
20 | # IDE - VSCode
21 | .vscode/*
22 | !.vscode/settings.json
23 | !.vscode/tasks.json
24 | !.vscode/launch.json
25 | !.vscode/extensions.json
26 |
27 | # misc
28 | /.sass-cache
29 | /connect.lock
30 | /coverage
31 | /libpeerconnection.log
32 | npm-debug.log
33 | testem.log
34 | /typings
35 |
36 | # e2e
37 | /e2e/*.js
38 | /e2e/*.map
39 |
40 | # System Files
41 | .DS_Store
42 | Thumbs.db
43 |
--------------------------------------------------------------------------------
/apps/menu/.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 | # IDEs and editors
12 | /.idea
13 | .project
14 | .classpath
15 | .c9/
16 | *.launch
17 | .settings/
18 | *.sublime-workspace
19 |
20 | # IDE - VSCode
21 | .vscode/*
22 | !.vscode/settings.json
23 | !.vscode/tasks.json
24 | !.vscode/launch.json
25 | !.vscode/extensions.json
26 |
27 | # misc
28 | /.sass-cache
29 | /connect.lock
30 | /coverage
31 | /libpeerconnection.log
32 | npm-debug.log
33 | testem.log
34 | /typings
35 |
36 | # e2e
37 | /e2e/*.js
38 | /e2e/*.map
39 |
40 | # System Files
41 | .DS_Store
42 | Thumbs.db
43 |
--------------------------------------------------------------------------------
/apps/menu/src/app/app.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed, async } from '@angular/core/testing';
2 | import { NO_ERRORS_SCHEMA } from '@angular/core';
3 |
4 | import { AppComponent } from './app.component';
5 |
6 | describe('AppComponent', () => {
7 | beforeEach(async(() => {
8 | TestBed.configureTestingModule({
9 | declarations: [
10 | AppComponent
11 | ],
12 | providers: [
13 | ],
14 | schemas: [NO_ERRORS_SCHEMA]
15 | }).compileComponents();
16 | }));
17 | it('should create the app', async(() => {
18 | const fixture = TestBed.createComponent(AppComponent);
19 | const app = fixture.debugElement.componentInstance;
20 | expect(app).toBeTruthy();
21 | }));
22 | });
23 |
--------------------------------------------------------------------------------
/apps/home/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { Router } from '@angular/router';
3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
4 | import { platformSingleSpa } from 'single-spa-angular-cli';
5 |
6 | import { AppModule } from './app/app.module';
7 | import { environment } from './environments/environment';
8 |
9 | if (environment.production) {
10 | enableProdMode();
11 | }
12 |
13 | platformSingleSpa.mount('home', Router).subscribe(({ props, attachUnmount }) => {
14 | platformBrowserDynamic().bootstrapModule(AppModule).then((module) => {
15 | attachUnmount(module);
16 | // Do something with props if you want
17 | // Ex : module.instance.setSomething(...)
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/apps/home/src/app/route1/route1.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { Route1Component } from './route1.component';
4 |
5 | describe('Route1Component', () => {
6 | let component: Route1Component;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ Route1Component ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(Route1Component);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/apps/home/src/app/route2module/route2.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { Route2Component } from './route2.component';
4 |
5 | describe('Route2Component', () => {
6 | let component: Route2Component;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ Route2Component ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(Route2Component);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/apps/menu/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { BrowserModule } from '@angular/platform-browser';
2 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
3 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
4 | import { MatToolbarModule, MatIconModule } from '@angular/material';
5 | import { SingleSpaModule } from 'single-spa-angular-cli/angular';
6 |
7 | import { AppComponent } from './app.component';
8 |
9 | @NgModule({
10 | declarations: [
11 | AppComponent
12 | ],
13 | imports: [
14 | BrowserModule,
15 | BrowserAnimationsModule,
16 | MatToolbarModule,
17 | MatIconModule,
18 | SingleSpaModule
19 | ],
20 | schemas: [NO_ERRORS_SCHEMA],
21 | providers: [],
22 | bootstrap: [AppComponent]
23 | })
24 | export class AppModule { }
25 |
--------------------------------------------------------------------------------
/apps/home/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { BrowserModule } from '@angular/platform-browser';
2 | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
3 | import { MatCardModule, MatButtonModule } from '@angular/material';
4 | import { SingleSpaModule } from 'single-spa-angular-cli/angular';
5 |
6 | import { AppComponent } from './app.component';
7 | import { Route1Component } from './route1/route1.component';
8 | import { AppRoutingModule } from './app-routing.module';
9 |
10 |
11 | @NgModule({
12 | declarations: [
13 | AppComponent,
14 | Route1Component
15 | ],
16 | imports: [
17 | BrowserModule,
18 | AppRoutingModule,
19 | MatCardModule,
20 | MatButtonModule,
21 | SingleSpaModule
22 | ],
23 | schemas: [NO_ERRORS_SCHEMA],
24 | providers: [],
25 | bootstrap: [AppComponent]
26 | })
27 | export class AppModule { }
28 |
--------------------------------------------------------------------------------
/apps/app1/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 | './e2e/**/*.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: 'e2e/tsconfig.e2e.json'
25 | });
26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/apps/help/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 | './e2e/**/*.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: 'e2e/tsconfig.e2e.json'
25 | });
26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/apps/home/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 | './e2e/**/*.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: 'e2e/tsconfig.e2e.json'
25 | });
26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/apps/menu/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 | './e2e/**/*.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: 'e2e/tsconfig.e2e.json'
25 | });
26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/apps/home/src/app/app.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed, async } from '@angular/core/testing';
2 | import { AppComponent } from './app.component';
3 | import { AppRoutingModule } from './app-routing.module';
4 | import { Route1Component } from './route1/route1.component';
5 | import { NO_ERRORS_SCHEMA } from '@angular/core';
6 | describe('AppComponent', () => {
7 | beforeEach(async(() => {
8 | TestBed.configureTestingModule({
9 | imports: [
10 | AppRoutingModule
11 | ],
12 | declarations: [
13 | AppComponent,
14 | Route1Component
15 | ],
16 | schemas: [NO_ERRORS_SCHEMA]
17 | }).compileComponents();
18 | }));
19 | it('should create the app', async(() => {
20 | const fixture = TestBed.createComponent(AppComponent);
21 | const app = fixture.debugElement.componentInstance;
22 | expect(app).toBeTruthy();
23 | }));
24 | });
25 |
--------------------------------------------------------------------------------
/apps/home/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Single SPA
5 | Angular CLI demonstration
6 |
7 |
8 |
9 |
10 |
11 |
12 | Route1
13 | Route2 (lazy)
14 | Open Help (other cli app)
15 | App1 (other cli app)
16 |
17 |
--------------------------------------------------------------------------------
/apps/home/src/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { RouterModule, Routes } from '@angular/router';
3 |
4 | import { Route1Component } from './route1/route1.component';
5 | import { APP_BASE_HREF } from '@angular/common';
6 |
7 | declare const window: any;
8 |
9 | const routes: Routes = [
10 | {
11 | path: '',
12 | children: [
13 | { path: 'route1', component: Route1Component },
14 | { path: 'route2', loadChildren: 'app/route2module/route2-routing.module#Route2RoutingModule' }
15 | ]
16 | }, {
17 | path: '**',
18 | redirectTo: 'home'
19 | }
20 | ];
21 |
22 | @NgModule({
23 | imports: [RouterModule.forRoot(routes)],
24 | providers: [
25 | { provide: APP_BASE_HREF, useValue: '/' + (window.location.pathname.split('/')[1] || '') }
26 | ],
27 | exports: [RouterModule]
28 | })
29 | export class AppRoutingModule { }
30 |
--------------------------------------------------------------------------------
/portal/main.js:
--------------------------------------------------------------------------------
1 | import { registerApplication, start } from 'single-spa';
2 | import { loader, router } from 'single-spa-angular-cli';
3 | import 'babel-polyfill';
4 | import 'zone.js';
5 |
6 | const applications = require('./applications.config.json');
7 |
8 | for (const application of applications) {
9 | registerApplication(
10 | application.name,
11 | (() => {
12 | const lifecycles = loader({
13 | name: application.name,
14 | selector: application.selector,
15 | baseHref: application.baseHref
16 | });
17 | return {
18 | bootstrap: [lifecycles.bootstrap],
19 | mount: [lifecycles.mount],
20 | unmount: [lifecycles.unmount],
21 | unload: [lifecycles.unload],
22 | };
23 | })(),
24 | router.matchRoute(application.matchRoute, application.isDefaultApp)
25 | );
26 | }
27 |
28 | start();
29 |
--------------------------------------------------------------------------------
/apps/home/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, NgZone } from '@angular/core';
2 |
3 | declare const location: any;
4 |
5 | @Component({
6 | selector: 'home-root',
7 | templateUrl: './app.component.html',
8 | styleUrls: ['./app.component.css']
9 | })
10 | export class AppComponent {
11 |
12 | constructor(private ngZone: NgZone) {
13 |
14 | }
15 |
16 | getHelpUrl(): string {
17 | let helpUrl;
18 | const match = location.href.match(/help=(open|close)/);
19 | const isOpen = match && match[1] === 'open';
20 | if (isOpen) {
21 | helpUrl = location.href.replace('help=open', 'help=close');
22 | } else {
23 | if (match) {
24 | helpUrl = location.href.replace('help=close', 'help=open');
25 | } else if (location.href.match(/\?/)) {
26 | helpUrl = `${location.href}&help=open`;
27 | } else {
28 | helpUrl = `${location.href}?help=open`;
29 | }
30 | }
31 | return helpUrl;
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/apps/menu/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | declare const location: any;
4 |
5 | @Component({
6 | selector: 'menu-root',
7 | templateUrl: './app.component.html',
8 | styleUrls: ['./app.component.scss']
9 | })
10 | export class AppComponent {
11 |
12 | toogleHelpUrl: string;
13 |
14 | constructor() {
15 |
16 | }
17 |
18 | getHelpUrl(): string {
19 | let helpUrl;
20 | const match = location.href.match(/help=(open|close)/);
21 | const isOpen = match && match[1] === 'open';
22 | if (isOpen) {
23 | helpUrl = location.href.replace('help=open', 'help=close');
24 | } else {
25 | if (match) {
26 | helpUrl = location.href.replace('help=close', 'help=open');
27 | } else if (location.href.match(/\?/)) {
28 | helpUrl = `${location.href}&help=open`;
29 | } else {
30 | helpUrl = `${location.href}?help=open`;
31 | }
32 | }
33 | return helpUrl;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/apps/help/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 | Help Apps
3 | {{url}}
4 |
5 |
6 |
7 |
8 |
9 | Self aware with panel 1
10 |
11 |
12 | Help 1
13 |
14 |
15 | I'm visible because I am open
16 |
17 |
18 |
19 |
20 | Self aware with panel 2
21 |
22 |
23 | Help 2
24 |
25 |
26 | I'm visible because I am open
27 |
28 |
29 |
--------------------------------------------------------------------------------
/apps/app1/src/app/app.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed, async } from '@angular/core/testing';
2 | import { AppComponent } from './app.component';
3 | describe('AppComponent', () => {
4 | beforeEach(async(() => {
5 | TestBed.configureTestingModule({
6 | declarations: [
7 | AppComponent
8 | ],
9 | }).compileComponents();
10 | }));
11 | it('should create the app', async(() => {
12 | const fixture = TestBed.createComponent(AppComponent);
13 | const app = fixture.debugElement.componentInstance;
14 | expect(app).toBeTruthy();
15 | }));
16 | it(`should have as title 'app1'`, async(() => {
17 | const fixture = TestBed.createComponent(AppComponent);
18 | const app = fixture.debugElement.componentInstance;
19 | expect(app.title).toEqual('app1');
20 | }));
21 | it('should render title in a h1 tag', async(() => {
22 | const fixture = TestBed.createComponent(AppComponent);
23 | fixture.detectChanges();
24 | const compiled = fixture.debugElement.nativeElement;
25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to app1!');
26 | }));
27 | });
28 |
--------------------------------------------------------------------------------
/apps/app1/README.md:
--------------------------------------------------------------------------------
1 | # App1
2 |
3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.3.
4 |
5 | ## Development server
6 |
7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8 |
9 | ## Code scaffolding
10 |
11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12 |
13 | ## Build
14 |
15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
16 |
17 | ## Running unit tests
18 |
19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20 |
21 | ## Running end-to-end tests
22 |
23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24 |
25 | ## Further help
26 |
27 | 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).
28 |
--------------------------------------------------------------------------------
/apps/help/README.md:
--------------------------------------------------------------------------------
1 | # Help
2 |
3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.3.
4 |
5 | ## Development server
6 |
7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8 |
9 | ## Code scaffolding
10 |
11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12 |
13 | ## Build
14 |
15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
16 |
17 | ## Running unit tests
18 |
19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20 |
21 | ## Running end-to-end tests
22 |
23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24 |
25 | ## Further help
26 |
27 | 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).
28 |
--------------------------------------------------------------------------------
/apps/menu/README.md:
--------------------------------------------------------------------------------
1 | # Menu
2 |
3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.3.
4 |
5 | ## Development server
6 |
7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8 |
9 | ## Code scaffolding
10 |
11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12 |
13 | ## Build
14 |
15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
16 |
17 | ## Running unit tests
18 |
19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20 |
21 | ## Running end-to-end tests
22 |
23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24 |
25 | ## Further help
26 |
27 | 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).
28 |
--------------------------------------------------------------------------------
/apps/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/cli'],
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/cli/plugins/karma')
14 | ],
15 | files: [
16 | 'node_modules/zone.js/dist/zone.js'
17 | ],
18 | client:{
19 | clearContext: false // leave Jasmine Spec Runner output visible in browser
20 | },
21 | coverageIstanbulReporter: {
22 | reports: [ 'html', 'lcovonly' ],
23 | fixWebpackSourcePaths: true
24 | },
25 | angularCli: {
26 | environment: 'dev'
27 | },
28 | reporters: ['progress', 'kjhtml'],
29 | port: 9876,
30 | colors: true,
31 | logLevel: config.LOG_INFO,
32 | autoWatch: true,
33 | browsers: ['Chrome'],
34 | singleRun: false
35 | });
36 | };
37 |
--------------------------------------------------------------------------------
/apps/help/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/cli'],
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/cli/plugins/karma')
14 | ],
15 | files: [
16 | 'node_modules/zone.js/dist/zone.js'
17 | ],
18 | client:{
19 | clearContext: false // leave Jasmine Spec Runner output visible in browser
20 | },
21 | coverageIstanbulReporter: {
22 | reports: [ 'html', 'lcovonly' ],
23 | fixWebpackSourcePaths: true
24 | },
25 | angularCli: {
26 | environment: 'dev'
27 | },
28 | reporters: ['progress', 'kjhtml'],
29 | port: 9876,
30 | colors: true,
31 | logLevel: config.LOG_INFO,
32 | autoWatch: true,
33 | browsers: ['Chrome'],
34 | singleRun: false
35 | });
36 | };
37 |
--------------------------------------------------------------------------------
/apps/home/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/cli'],
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/cli/plugins/karma')
14 | ],
15 | files: [
16 | 'node_modules/zone.js/dist/zone.js'
17 | ],
18 | client:{
19 | clearContext: false // leave Jasmine Spec Runner output visible in browser
20 | },
21 | coverageIstanbulReporter: {
22 | reports: [ 'html', 'lcovonly' ],
23 | fixWebpackSourcePaths: true
24 | },
25 | angularCli: {
26 | environment: 'dev'
27 | },
28 | reporters: ['progress', 'kjhtml'],
29 | port: 9876,
30 | colors: true,
31 | logLevel: config.LOG_INFO,
32 | autoWatch: true,
33 | browsers: ['Chrome'],
34 | singleRun: false
35 | });
36 | };
37 |
--------------------------------------------------------------------------------
/apps/menu/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/cli'],
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/cli/plugins/karma')
14 | ],
15 | files: [
16 | 'node_modules/zone.js/dist/zone.js'
17 | ],
18 | client:{
19 | clearContext: false // leave Jasmine Spec Runner output visible in browser
20 | },
21 | coverageIstanbulReporter: {
22 | reports: [ 'html', 'lcovonly' ],
23 | fixWebpackSourcePaths: true
24 | },
25 | angularCli: {
26 | environment: 'dev'
27 | },
28 | reporters: ['progress', 'kjhtml'],
29 | port: 9876,
30 | colors: true,
31 | logLevel: config.LOG_INFO,
32 | autoWatch: true,
33 | browsers: ['Chrome'],
34 | singleRun: false
35 | });
36 | };
37 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018 Robin Coma Delperier
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/apps/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/long-stack-trace-zone';
4 | import 'zone.js/dist/proxy.js';
5 | import 'zone.js/dist/sync-test';
6 | import 'zone.js/dist/jasmine-patch';
7 | import 'zone.js/dist/async-test';
8 | import 'zone.js/dist/fake-async-test';
9 | import { getTestBed } from '@angular/core/testing';
10 | import {
11 | BrowserDynamicTestingModule,
12 | platformBrowserDynamicTesting
13 | } from '@angular/platform-browser-dynamic/testing';
14 |
15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
16 | declare const __karma__: any;
17 | declare const require: any;
18 |
19 | // Prevent Karma from running prematurely.
20 | __karma__.loaded = function () {};
21 |
22 | // First, initialize the Angular testing environment.
23 | getTestBed().initTestEnvironment(
24 | BrowserDynamicTestingModule,
25 | platformBrowserDynamicTesting()
26 | );
27 | // Then we find all the tests.
28 | const context = require.context('./', true, /\.spec\.ts$/);
29 | // And load the modules.
30 | context.keys().map(context);
31 | // Finally, start Karma to run the tests.
32 | __karma__.start();
33 |
--------------------------------------------------------------------------------
/apps/help/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/long-stack-trace-zone';
4 | import 'zone.js/dist/proxy.js';
5 | import 'zone.js/dist/sync-test';
6 | import 'zone.js/dist/jasmine-patch';
7 | import 'zone.js/dist/async-test';
8 | import 'zone.js/dist/fake-async-test';
9 | import { getTestBed } from '@angular/core/testing';
10 | import {
11 | BrowserDynamicTestingModule,
12 | platformBrowserDynamicTesting
13 | } from '@angular/platform-browser-dynamic/testing';
14 |
15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
16 | declare const __karma__: any;
17 | declare const require: any;
18 |
19 | // Prevent Karma from running prematurely.
20 | __karma__.loaded = function () {};
21 |
22 | // First, initialize the Angular testing environment.
23 | getTestBed().initTestEnvironment(
24 | BrowserDynamicTestingModule,
25 | platformBrowserDynamicTesting()
26 | );
27 | // Then we find all the tests.
28 | const context = require.context('./', true, /\.spec\.ts$/);
29 | // And load the modules.
30 | context.keys().map(context);
31 | // Finally, start Karma to run the tests.
32 | __karma__.start();
33 |
--------------------------------------------------------------------------------
/apps/home/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/long-stack-trace-zone';
4 | import 'zone.js/dist/proxy.js';
5 | import 'zone.js/dist/sync-test';
6 | import 'zone.js/dist/jasmine-patch';
7 | import 'zone.js/dist/async-test';
8 | import 'zone.js/dist/fake-async-test';
9 | import { getTestBed } from '@angular/core/testing';
10 | import {
11 | BrowserDynamicTestingModule,
12 | platformBrowserDynamicTesting
13 | } from '@angular/platform-browser-dynamic/testing';
14 |
15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
16 | declare const __karma__: any;
17 | declare const require: any;
18 |
19 | // Prevent Karma from running prematurely.
20 | __karma__.loaded = function () {};
21 |
22 | // First, initialize the Angular testing environment.
23 | getTestBed().initTestEnvironment(
24 | BrowserDynamicTestingModule,
25 | platformBrowserDynamicTesting()
26 | );
27 | // Then we find all the tests.
28 | const context = require.context('./', true, /\.spec\.ts$/);
29 | // And load the modules.
30 | context.keys().map(context);
31 | // Finally, start Karma to run the tests.
32 | __karma__.start();
33 |
--------------------------------------------------------------------------------
/apps/menu/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/long-stack-trace-zone';
4 | import 'zone.js/dist/proxy.js';
5 | import 'zone.js/dist/sync-test';
6 | import 'zone.js/dist/jasmine-patch';
7 | import 'zone.js/dist/async-test';
8 | import 'zone.js/dist/fake-async-test';
9 | import { getTestBed } from '@angular/core/testing';
10 | import {
11 | BrowserDynamicTestingModule,
12 | platformBrowserDynamicTesting
13 | } from '@angular/platform-browser-dynamic/testing';
14 |
15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
16 | declare const __karma__: any;
17 | declare const require: any;
18 |
19 | // Prevent Karma from running prematurely.
20 | __karma__.loaded = function () {};
21 |
22 | // First, initialize the Angular testing environment.
23 | getTestBed().initTestEnvironment(
24 | BrowserDynamicTestingModule,
25 | platformBrowserDynamicTesting()
26 | );
27 | // Then we find all the tests.
28 | const context = require.context('./', true, /\.spec\.ts$/);
29 | // And load the modules.
30 | context.keys().map(context);
31 | // Finally, start Karma to run the tests.
32 | __karma__.start();
33 |
--------------------------------------------------------------------------------
/apps/home/README.md:
--------------------------------------------------------------------------------
1 | # WebComponentApp
2 |
3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.3.
4 |
5 | ## Develop the application without single SPA
6 |
7 | Run window.angular5mf.mount() to lanch the apps
8 |
9 | ## Build the application for single SPA
10 |
11 | Run `npm run build:singleSpa`
12 |
13 | ## Use the application served by cli inside single SPA
14 |
15 | Run `npm run serve:singleSpa`
16 |
17 | ## Development server
18 |
19 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
20 |
21 | ## Code scaffolding
22 |
23 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
24 |
25 | ## Build
26 |
27 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
28 |
29 | ## Running unit tests
30 |
31 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
32 |
33 | ## Running end-to-end tests
34 |
35 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
36 |
37 | ## Further help
38 |
39 | 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).
40 |
--------------------------------------------------------------------------------
/apps/app1/.angular-cli.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "project": {
4 | "name": "app1"
5 | },
6 | "apps": [
7 | {
8 | "root": "src",
9 | "outDir": "dist",
10 | "assets": [
11 | "assets",
12 | "favicon.ico"
13 | ],
14 | "index": "index.html",
15 | "main": "main.ts",
16 | "polyfills": "polyfills.ts",
17 | "test": "test.ts",
18 | "tsconfig": "tsconfig.app.json",
19 | "testTsconfig": "tsconfig.spec.json",
20 | "prefix": "app1",
21 | "styles": [
22 | "styles.css"
23 | ],
24 | "scripts": [],
25 | "environmentSource": "environments/environment.ts",
26 | "environments": {
27 | "dev": "environments/environment.ts",
28 | "prod": "environments/environment.prod.ts"
29 | }
30 | }
31 | ],
32 | "e2e": {
33 | "protractor": {
34 | "config": "./protractor.conf.js"
35 | }
36 | },
37 | "lint": [
38 | {
39 | "project": "src/tsconfig.app.json",
40 | "exclude": "**/node_modules/**"
41 | },
42 | {
43 | "project": "src/tsconfig.spec.json",
44 | "exclude": "**/node_modules/**"
45 | },
46 | {
47 | "project": "e2e/tsconfig.e2e.json",
48 | "exclude": "**/node_modules/**"
49 | }
50 | ],
51 | "test": {
52 | "karma": {
53 | "config": "./karma.conf.js"
54 | }
55 | },
56 | "defaults": {
57 | "styleExt": "css",
58 | "component": {}
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/apps/help/.angular-cli.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "project": {
4 | "name": "help"
5 | },
6 | "apps": [
7 | {
8 | "root": "src",
9 | "outDir": "dist",
10 | "assets": [
11 | "assets",
12 | "favicon.ico"
13 | ],
14 | "index": "index.html",
15 | "main": "main.ts",
16 | "polyfills": "polyfills.ts",
17 | "test": "test.ts",
18 | "tsconfig": "tsconfig.app.json",
19 | "testTsconfig": "tsconfig.spec.json",
20 | "prefix": "help",
21 | "styles": [
22 | "styles.css"
23 | ],
24 | "scripts": [],
25 | "environmentSource": "environments/environment.ts",
26 | "environments": {
27 | "dev": "environments/environment.ts",
28 | "prod": "environments/environment.prod.ts"
29 | }
30 | }
31 | ],
32 | "e2e": {
33 | "protractor": {
34 | "config": "./protractor.conf.js"
35 | }
36 | },
37 | "lint": [
38 | {
39 | "project": "src/tsconfig.app.json",
40 | "exclude": "**/node_modules/**"
41 | },
42 | {
43 | "project": "src/tsconfig.spec.json",
44 | "exclude": "**/node_modules/**"
45 | },
46 | {
47 | "project": "e2e/tsconfig.e2e.json",
48 | "exclude": "**/node_modules/**"
49 | }
50 | ],
51 | "test": {
52 | "karma": {
53 | "config": "./karma.conf.js"
54 | }
55 | },
56 | "defaults": {
57 | "styleExt": "css",
58 | "component": {}
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/apps/menu/.angular-cli.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "project": {
4 | "name": "menu"
5 | },
6 | "apps": [
7 | {
8 | "root": "src",
9 | "outDir": "dist",
10 | "assets": [
11 | "assets",
12 | "favicon.ico"
13 | ],
14 | "index": "index.html",
15 | "main": "main.ts",
16 | "polyfills": "polyfills.ts",
17 | "test": "test.ts",
18 | "tsconfig": "tsconfig.app.json",
19 | "testTsconfig": "tsconfig.spec.json",
20 | "prefix": "menu",
21 | "styles": [
22 | "styles.scss"
23 | ],
24 | "scripts": [],
25 | "environmentSource": "environments/environment.ts",
26 | "environments": {
27 | "dev": "environments/environment.ts",
28 | "prod": "environments/environment.prod.ts"
29 | }
30 | }
31 | ],
32 | "e2e": {
33 | "protractor": {
34 | "config": "./protractor.conf.js"
35 | }
36 | },
37 | "lint": [
38 | {
39 | "project": "src/tsconfig.app.json",
40 | "exclude": "**/node_modules/**"
41 | },
42 | {
43 | "project": "src/tsconfig.spec.json",
44 | "exclude": "**/node_modules/**"
45 | },
46 | {
47 | "project": "e2e/tsconfig.e2e.json",
48 | "exclude": "**/node_modules/**"
49 | }
50 | ],
51 | "test": {
52 | "karma": {
53 | "config": "./karma.conf.js"
54 | }
55 | },
56 | "defaults": {
57 | "styleExt": "scss",
58 | "component": {}
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/apps/home/.angular-cli.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "project": {
4 | "name": "single-spa-examples"
5 | },
6 | "apps": [
7 | {
8 | "root": "src",
9 | "outDir": "dist",
10 | "assets": [
11 | "assets",
12 | "favicon.ico"
13 | ],
14 | "index": "index.html",
15 | "main": "main.ts",
16 | "polyfills": "polyfills.ts",
17 | "test": "test.ts",
18 | "tsconfig": "tsconfig.app.json",
19 | "testTsconfig": "tsconfig.spec.json",
20 | "prefix": "home",
21 | "styles": [
22 | "styles.css"
23 | ],
24 | "scripts": [],
25 | "environmentSource": "environments/environment.ts",
26 | "environments": {
27 | "dev": "environments/environment.ts",
28 | "prod": "environments/environment.prod.ts"
29 | }
30 | }
31 | ],
32 | "e2e": {
33 | "protractor": {
34 | "config": "./protractor.conf.js"
35 | }
36 | },
37 | "lint": [
38 | {
39 | "project": "src/tsconfig.app.json",
40 | "exclude": "**/node_modules/**"
41 | },
42 | {
43 | "project": "src/tsconfig.spec.json",
44 | "exclude": "**/node_modules/**"
45 | },
46 | {
47 | "project": "e2e/tsconfig.e2e.json",
48 | "exclude": "**/node_modules/**"
49 | }
50 | ],
51 | "test": {
52 | "karma": {
53 | "config": "./karma.conf.js"
54 | }
55 | },
56 | "defaults": {
57 | "styleExt": "css",
58 | "component": {}
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/apps/app1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "app1",
3 | "version": "0.0.0",
4 | "license": "MIT",
5 | "scripts": {
6 | "ng": "ng",
7 | "start": "ng serve",
8 | "build": "ng build --prod",
9 | "test": "ng test",
10 | "lint": "ng lint",
11 | "e2e": "ng e2e"
12 | },
13 | "private": true,
14 | "dependencies": {
15 | "@angular/animations": "^5.2.7",
16 | "@angular/cdk": "^5.2.3",
17 | "@angular/common": "^5.2.9",
18 | "@angular/compiler": "^5.2.9",
19 | "@angular/core": "^5.2.9",
20 | "@angular/forms": "^5.2.9",
21 | "@angular/http": "^5.2.9",
22 | "@angular/material": "^5.2.3",
23 | "@angular/platform-browser": "^5.2.9",
24 | "@angular/platform-browser-dynamic": "^5.2.9",
25 | "@angular/router": "^5.2.9",
26 | "core-js": "^2.4.1",
27 | "rxjs": "^5.5.2",
28 | "zone.js": "^0.8.14"
29 | },
30 | "devDependencies": {
31 | "@angular-devkit/core": "^0.4.3",
32 | "@angular/cli": "1.6.3",
33 | "@angular/compiler-cli": "^5.2.9",
34 | "@angular/language-service": "^5.2.9",
35 | "@types/jasmine": "~2.5.53",
36 | "@types/jasminewd2": "~2.0.2",
37 | "@types/node": "~6.0.60",
38 | "codelyzer": "^4.0.1",
39 | "jasmine-core": "~2.6.2",
40 | "jasmine-spec-reporter": "~4.1.0",
41 | "karma": "~1.7.0",
42 | "karma-chrome-launcher": "~2.1.1",
43 | "karma-cli": "~1.0.1",
44 | "karma-coverage-istanbul-reporter": "^1.2.1",
45 | "karma-jasmine": "~1.1.0",
46 | "karma-jasmine-html-reporter": "^0.2.2",
47 | "protractor": "~5.1.2",
48 | "ts-node": "~3.2.0",
49 | "tslint": "~5.7.0",
50 | "typescript": "^2.6.2"
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/apps/help/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "help",
3 | "version": "0.0.0",
4 | "license": "MIT",
5 | "scripts": {
6 | "ng": "ng",
7 | "start": "ng serve",
8 | "build": "ng build --prod",
9 | "test": "ng test",
10 | "lint": "ng lint",
11 | "e2e": "ng e2e"
12 | },
13 | "private": true,
14 | "dependencies": {
15 | "@angular/animations": "^5.2.7",
16 | "@angular/cdk": "^5.2.3",
17 | "@angular/common": "^5.2.9",
18 | "@angular/compiler": "^5.2.9",
19 | "@angular/core": "^5.2.9",
20 | "@angular/forms": "^5.2.9",
21 | "@angular/http": "^5.2.9",
22 | "@angular/material": "^5.2.3",
23 | "@angular/platform-browser": "^5.2.9",
24 | "@angular/platform-browser-dynamic": "^5.2.9",
25 | "@angular/router": "^5.2.9",
26 | "core-js": "^2.4.1",
27 | "rxjs": "^5.5.2",
28 | "zone.js": "^0.8.14"
29 | },
30 | "devDependencies": {
31 | "@angular-devkit/core": "^0.4.3",
32 | "@angular/cli": "1.6.3",
33 | "@angular/compiler-cli": "^5.2.9",
34 | "@angular/language-service": "^5.2.9",
35 | "@types/jasmine": "~2.5.53",
36 | "@types/jasminewd2": "~2.0.2",
37 | "@types/node": "~6.0.60",
38 | "codelyzer": "^4.0.1",
39 | "jasmine-core": "~2.6.2",
40 | "jasmine-spec-reporter": "~4.1.0",
41 | "karma": "~1.7.0",
42 | "karma-chrome-launcher": "~2.1.1",
43 | "karma-cli": "~1.0.1",
44 | "karma-coverage-istanbul-reporter": "^1.2.1",
45 | "karma-jasmine": "~1.1.0",
46 | "karma-jasmine-html-reporter": "^0.2.2",
47 | "protractor": "~5.1.2",
48 | "ts-node": "~3.2.0",
49 | "tslint": "~5.7.0",
50 | "typescript": "^2.6.2"
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/apps/home/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "home",
3 | "version": "0.0.0",
4 | "license": "MIT",
5 | "scripts": {
6 | "ng": "ng",
7 | "start": "ng serve",
8 | "build": "ng build --prod",
9 | "test": "ng test",
10 | "lint": "ng lint",
11 | "e2e": "ng e2e"
12 | },
13 | "private": true,
14 | "dependencies": {
15 | "@angular/animations": "^5.2.7",
16 | "@angular/cdk": "^5.2.3",
17 | "@angular/common": "^5.2.9",
18 | "@angular/compiler": "^5.2.9",
19 | "@angular/core": "^5.2.9",
20 | "@angular/forms": "^5.2.9",
21 | "@angular/http": "^5.2.9",
22 | "@angular/material": "^5.2.3",
23 | "@angular/platform-browser": "^5.2.9",
24 | "@angular/platform-browser-dynamic": "^5.2.9",
25 | "@angular/router": "^5.2.9",
26 | "core-js": "^2.4.1",
27 | "rxjs": "^5.5.2",
28 | "zone.js": "^0.8.14"
29 | },
30 | "devDependencies": {
31 | "@angular-devkit/core": "^0.4.3",
32 | "@angular/cli": "1.6.3",
33 | "@angular/compiler-cli": "^5.2.9",
34 | "@angular/language-service": "^5.2.9",
35 | "@types/jasmine": "~2.5.53",
36 | "@types/jasminewd2": "~2.0.2",
37 | "@types/node": "~6.0.60",
38 | "codelyzer": "^4.0.1",
39 | "jasmine-core": "~2.6.2",
40 | "jasmine-spec-reporter": "~4.1.0",
41 | "karma": "~1.7.0",
42 | "karma-chrome-launcher": "~2.1.1",
43 | "karma-cli": "~1.0.1",
44 | "karma-coverage-istanbul-reporter": "^1.2.1",
45 | "karma-jasmine": "~1.1.0",
46 | "karma-jasmine-html-reporter": "^0.2.2",
47 | "protractor": "~5.1.2",
48 | "single-spa-angular-cli": "0.4.1",
49 | "ts-node": "~3.2.0",
50 | "tslint": "~5.7.0",
51 | "typescript": "^2.6.2"
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/apps/menu/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "menu",
3 | "version": "0.0.0",
4 | "license": "MIT",
5 | "scripts": {
6 | "ng": "ng",
7 | "start": "ng serve",
8 | "build": "ng build --prod",
9 | "test": "ng test",
10 | "lint": "ng lint",
11 | "e2e": "ng e2e"
12 | },
13 | "private": true,
14 | "dependencies": {
15 | "@angular/animations": "^5.2.7",
16 | "@angular/cdk": "^5.2.3",
17 | "@angular/common": "^5.2.9",
18 | "@angular/compiler": "^5.2.9",
19 | "@angular/core": "^5.2.9",
20 | "@angular/forms": "^5.2.9",
21 | "@angular/http": "^5.2.9",
22 | "@angular/material": "^5.2.3",
23 | "@angular/platform-browser": "^5.2.9",
24 | "@angular/platform-browser-dynamic": "^5.2.9",
25 | "@angular/router": "^5.2.9",
26 | "core-js": "^2.4.1",
27 | "rxjs": "^5.5.2",
28 | "zone.js": "^0.8.14"
29 | },
30 | "devDependencies": {
31 | "@angular-devkit/core": "^0.4.3",
32 | "@angular/cli": "1.6.3",
33 | "@angular/compiler-cli": "^5.2.9",
34 | "@angular/language-service": "^5.2.9",
35 | "@types/jasmine": "~2.5.53",
36 | "@types/jasminewd2": "~2.0.2",
37 | "@types/node": "~6.0.60",
38 | "codelyzer": "^4.0.1",
39 | "jasmine-core": "~2.6.2",
40 | "jasmine-spec-reporter": "~4.1.0",
41 | "karma": "~1.7.0",
42 | "karma-chrome-launcher": "~2.1.1",
43 | "karma-cli": "~1.0.1",
44 | "karma-coverage-istanbul-reporter": "^1.2.1",
45 | "karma-jasmine": "~1.1.0",
46 | "karma-jasmine-html-reporter": "^0.2.2",
47 | "protractor": "~5.1.2",
48 | "single-spa-angular-cli": "0.4.1",
49 | "ts-node": "~3.2.0",
50 | "tslint": "~5.7.0",
51 | "typescript": "^2.6.2"
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.0.0",
3 | "name": "single-spa-angular-cli-exemples",
4 | "description": "This is an example of examples on how to use [single-spa](https://github.com/CanopyTax/single-spa) && [single-spa-angular-cli](https://github.com/PlaceMe-SAS/single-spa-angular-cli) in a variety of contexts. Right now there are examples with the following technologies:",
5 | "scripts": {
6 | "preinstall": "cd ./apps/menu && npm i && cd ../home && npm i && cd ../app1 && npm i && cd ../help && npm i",
7 | "ng:lint": "cd ./apps/menu && ng lint && cd ../home && ng lint && cd ../app1 && ng lint && cd ../help && ng lint",
8 | "ng:test": "cd ./apps/menu && ng test --watch=false && cd ../home && ng test --watch=false && cd ../app1 && ng test --watch=false && cd ../help && ng test --watch=false",
9 | "ng:build": "cd ./apps/menu && ng build --prod --aot=false -op ../../build/menu && cd ../home && ng build --prod --aot=false -op ../../build/home && cd ../app1 && ng build --prod -op ../../build/app1 && cd ../help && ng build --prod -op ../../build/help",
10 | "start": "webpack-dev-server --open",
11 | "build": "webpack --config webpack.config.js"
12 | },
13 | "repository": {
14 | "type": "git",
15 | "url": "git+git@github.com:PlaceMe-SAS/single-spa-examples.git"
16 | },
17 | "author": "Robin Coma Delperier",
18 | "license": "Apache-2.0",
19 | "bugs": {
20 | "url": "https://github.com/PlaceMe-SAS/single-spa-examples/issues"
21 | },
22 | "homepage": "https://github.com/PlaceMe-SAS/single-spa-examples#readme",
23 | "devDependencies": {
24 | "@angular-devkit/core": "^0.4.3",
25 | "@angular/cli": "^1.7.4",
26 | "babel-core": "^6.26.3",
27 | "babel-loader": "^7.1.2",
28 | "babel-plugin-syntax-dynamic-import": "^6.18.0",
29 | "babel-plugin-transform-class-properties": "^6.24.1",
30 | "babel-plugin-transform-function-bind": "^6.22.0",
31 | "babel-plugin-transform-object-rest-spread": "^6.26.0",
32 | "babel-polyfill": "^6.26.0",
33 | "babel-preset-env": "^1.7.0",
34 | "babel-preset-es2015": "^6.24.1",
35 | "babel-preset-react": "^6.24.1",
36 | "cpx": "^1.5.0",
37 | "css-loader": "^0.28.7",
38 | "html-loader": "^0.5.1",
39 | "rimraf": "^2.6.2",
40 | "style-loader": "^0.19.0",
41 | "webpack": "^3.11.0",
42 | "webpack-dev-server": "^2.9.7"
43 | },
44 | "dependencies": {
45 | "single-spa": "^3.9.0",
46 | "single-spa-angular-cli": "0.4.1",
47 | "zone.js": "^0.8.14"
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/apps/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/docs/ts/latest/guide/browser-support.html
15 | */
16 |
17 | /***************************************************************************************************
18 | * BROWSER POLYFILLS
19 | */
20 |
21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/
22 | // import 'core-js/es6/symbol';
23 | // import 'core-js/es6/object';
24 | // import 'core-js/es6/function';
25 | // import 'core-js/es6/parse-int';
26 | // import 'core-js/es6/parse-float';
27 | // import 'core-js/es6/number';
28 | // import 'core-js/es6/math';
29 | // import 'core-js/es6/string';
30 | // import 'core-js/es6/date';
31 | // import 'core-js/es6/array';
32 | // import 'core-js/es6/regexp';
33 | // import 'core-js/es6/map';
34 | // import 'core-js/es6/weak-map';
35 | // import 'core-js/es6/set';
36 |
37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */
38 | // import 'classlist.js'; // Run `npm install --save classlist.js`.
39 |
40 | /** IE10 and IE11 requires the following for the Reflect API. */
41 | // import 'core-js/es6/reflect';
42 |
43 |
44 | /** Evergreen browsers require these. **/
45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
46 | import 'core-js/es7/reflect';
47 |
48 |
49 | /**
50 | * Required to support Web Animations `@angular/platform-browser/animations`.
51 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
52 | **/
53 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
54 |
55 |
56 |
57 | /***************************************************************************************************
58 | * Zone JS is required by default for Angular itself.
59 | */
60 | // import 'zone.js/dist/zone'; // Included with Angular CLI.
61 |
62 |
63 |
64 | /***************************************************************************************************
65 | * APPLICATION IMPORTS
66 | */
67 |
--------------------------------------------------------------------------------
/apps/help/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/docs/ts/latest/guide/browser-support.html
15 | */
16 |
17 | /***************************************************************************************************
18 | * BROWSER POLYFILLS
19 | */
20 |
21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/
22 | // import 'core-js/es6/symbol';
23 | // import 'core-js/es6/object';
24 | // import 'core-js/es6/function';
25 | // import 'core-js/es6/parse-int';
26 | // import 'core-js/es6/parse-float';
27 | // import 'core-js/es6/number';
28 | // import 'core-js/es6/math';
29 | // import 'core-js/es6/string';
30 | // import 'core-js/es6/date';
31 | // import 'core-js/es6/array';
32 | // import 'core-js/es6/regexp';
33 | // import 'core-js/es6/map';
34 | // import 'core-js/es6/weak-map';
35 | // import 'core-js/es6/set';
36 |
37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */
38 | // import 'classlist.js'; // Run `npm install --save classlist.js`.
39 |
40 | /** IE10 and IE11 requires the following for the Reflect API. */
41 | // import 'core-js/es6/reflect';
42 |
43 |
44 | /** Evergreen browsers require these. **/
45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
46 | import 'core-js/es7/reflect';
47 |
48 |
49 | /**
50 | * Required to support Web Animations `@angular/platform-browser/animations`.
51 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
52 | **/
53 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
54 |
55 |
56 |
57 | /***************************************************************************************************
58 | * Zone JS is required by default for Angular itself.
59 | */
60 | // import 'zone.js/dist/zone'; // Included with Angular CLI.
61 |
62 |
63 |
64 | /***************************************************************************************************
65 | * APPLICATION IMPORTS
66 | */
67 |
--------------------------------------------------------------------------------
/apps/home/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/docs/ts/latest/guide/browser-support.html
15 | */
16 |
17 | /***************************************************************************************************
18 | * BROWSER POLYFILLS
19 | */
20 |
21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/
22 | // import 'core-js/es6/symbol';
23 | // import 'core-js/es6/object';
24 | // import 'core-js/es6/function';
25 | // import 'core-js/es6/parse-int';
26 | // import 'core-js/es6/parse-float';
27 | // import 'core-js/es6/number';
28 | // import 'core-js/es6/math';
29 | // import 'core-js/es6/string';
30 | // import 'core-js/es6/date';
31 | // import 'core-js/es6/array';
32 | // import 'core-js/es6/regexp';
33 | // import 'core-js/es6/map';
34 | // import 'core-js/es6/weak-map';
35 | // import 'core-js/es6/set';
36 |
37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */
38 | // import 'classlist.js'; // Run `npm install --save classlist.js`.
39 |
40 | /** IE10 and IE11 requires the following for the Reflect API. */
41 | // import 'core-js/es6/reflect';
42 |
43 |
44 | /** Evergreen browsers require these. **/
45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
46 | import 'core-js/es7/reflect';
47 |
48 |
49 | /**
50 | * Required to support Web Animations `@angular/platform-browser/animations`.
51 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
52 | **/
53 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
54 |
55 |
56 |
57 | /***************************************************************************************************
58 | * Zone JS is required by default for Angular itself.
59 | */
60 | // import 'zone.js/dist/zone'; // Included with Angular CLI.
61 |
62 |
63 |
64 | /***************************************************************************************************
65 | * APPLICATION IMPORTS
66 | */
67 |
--------------------------------------------------------------------------------
/apps/menu/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/docs/ts/latest/guide/browser-support.html
15 | */
16 |
17 | /***************************************************************************************************
18 | * BROWSER POLYFILLS
19 | */
20 |
21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/
22 | // import 'core-js/es6/symbol';
23 | // import 'core-js/es6/object';
24 | // import 'core-js/es6/function';
25 | // import 'core-js/es6/parse-int';
26 | // import 'core-js/es6/parse-float';
27 | // import 'core-js/es6/number';
28 | // import 'core-js/es6/math';
29 | // import 'core-js/es6/string';
30 | // import 'core-js/es6/date';
31 | // import 'core-js/es6/array';
32 | // import 'core-js/es6/regexp';
33 | // import 'core-js/es6/map';
34 | // import 'core-js/es6/weak-map';
35 | // import 'core-js/es6/set';
36 |
37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */
38 | // import 'classlist.js'; // Run `npm install --save classlist.js`.
39 |
40 | /** IE10 and IE11 requires the following for the Reflect API. */
41 | // import 'core-js/es6/reflect';
42 |
43 |
44 | /** Evergreen browsers require these. **/
45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
46 | import 'core-js/es7/reflect';
47 |
48 |
49 | /**
50 | * Required to support Web Animations `@angular/platform-browser/animations`.
51 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
52 | **/
53 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
54 |
55 |
56 |
57 | /***************************************************************************************************
58 | * Zone JS is required by default for Angular itself.
59 | */
60 | // import 'zone.js/dist/zone'; // Included with Angular CLI.
61 |
62 |
63 |
64 | /***************************************************************************************************
65 | * APPLICATION IMPORTS
66 | */
67 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | const webpack = require('webpack');
2 | const path = require('path');
3 | const applications = require('./portal/applications.config.json');
4 |
5 | const PORT = 8080;
6 |
7 | const devApplications = {
8 | // menu: 'http://localhost:4200',
9 | // home: 'http://localhost:4201',
10 | // app1: 'http://localhost:4202',
11 | // help: 'http://localhost:4203'
12 | };
13 |
14 | module.exports = {
15 | entry: [
16 | __dirname + '/portal/main.js',
17 | __dirname + '/portal/main.css'
18 | ],
19 | output: {
20 | path: process.cwd() + '/build',
21 | filename: '[name].js',
22 | publicPath: '/build/',
23 | },
24 | devtool: 'inline-source-map',
25 | devServer: {
26 | port: PORT,
27 | publicPath: '/build/',
28 | contentBase: './',
29 | historyApiFallback: true,
30 | proxy: getProxyConfig(applications, devApplications),
31 | },
32 | resolve: {
33 | modules: [
34 | 'node_modules',
35 | path.resolve(__dirname, './'),
36 | ],
37 | },
38 | module: {
39 | rules: [
40 | {
41 | test: /\.css$/,
42 | use: ['style-loader', 'css-loader']
43 | },
44 | {
45 | test: /\.html$/,
46 | exclude: /node_modules|svelte/,
47 | loader: 'html-loader',
48 | },
49 | {
50 | test: /\.js$/,
51 | exclude: /node_modules/,
52 | loader: 'babel-loader',
53 | query: getBabelConfig(),
54 | }
55 | ],
56 | },
57 | plugins: [
58 | new webpack.optimize.CommonsChunkPlugin({
59 | name: 'common',
60 | minChunks: module => module.context && module.context.indexOf('node_modules') !== -1
61 | }),
62 | ],
63 | };
64 |
65 | function getBabelConfig() {
66 | return {
67 | presets: [
68 | ['babel-preset-env', {
69 | targets: {
70 | 'browsers': ['last 2 versions'],
71 | },
72 | }],
73 | ],
74 | plugins: [
75 | 'transform-object-rest-spread',
76 | 'transform-class-properties',
77 | 'syntax-dynamic-import',
78 | 'transform-function-bind',
79 | ],
80 | };
81 | }
82 | function getProxyConfig(applications, devApplications) {
83 | const proxy = {};
84 | for (app of applications) {
85 | const path = app.baseHref + '/';
86 | let target = `http://localhost:${PORT}/build/${path}`;
87 | if (devApplications.hasOwnProperty(app.name)) {
88 | target = devApplications[app.name];
89 | }
90 | proxy[path] = {
91 | target: target,
92 | pathRewrite: {
93 | [path]: ''
94 | },
95 | bypass: function (req, res, proxyOptions) {
96 | if (req.headers.accept.indexOf('html') !== -1) {
97 | return '/index.html';
98 | }
99 | }
100 | };
101 | }
102 | return proxy;
103 | }
104 | /**
105 | function getProxyConfig(applications, devApplications) {
106 | const proxy = {};
107 | for (const appName of Object.keys(devApplications)) {
108 | const application = applications.find(a => a.name === appName);
109 | const path = application.baseHref + '/';
110 | proxy[path] = {
111 | target: devApplications[appName],
112 | pathRewrite: {
113 | [path]: ''
114 | },
115 | bypass: function (req, res, proxyOptions) {
116 | if (req.headers.accept.indexOf('html') !== -1) {
117 | return '/index.html';
118 | }
119 | }
120 | };
121 | }
122 | return proxy;
123 | }
124 | */
--------------------------------------------------------------------------------
/apps/app1/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rulesDirectory": [
3 | "node_modules/codelyzer"
4 | ],
5 | "rules": {
6 | "arrow-return-shorthand": true,
7 | "callable-types": true,
8 | "class-name": true,
9 | "comment-format": [
10 | true,
11 | "check-space"
12 | ],
13 | "curly": true,
14 | "deprecation": {
15 | "severity": "warn"
16 | },
17 | "eofline": true,
18 | "forin": true,
19 | "import-blacklist": [
20 | true,
21 | "rxjs",
22 | "rxjs/Rx"
23 | ],
24 | "import-spacing": true,
25 | "indent": [
26 | true,
27 | "spaces"
28 | ],
29 | "interface-over-type-literal": true,
30 | "label-position": true,
31 | "max-line-length": [
32 | true,
33 | 140
34 | ],
35 | "member-access": false,
36 | "member-ordering": [
37 | true,
38 | {
39 | "order": [
40 | "static-field",
41 | "instance-field",
42 | "static-method",
43 | "instance-method"
44 | ]
45 | }
46 | ],
47 | "no-arg": true,
48 | "no-bitwise": true,
49 | "no-console": [
50 | true,
51 | "debug",
52 | "info",
53 | "time",
54 | "timeEnd",
55 | "trace"
56 | ],
57 | "no-construct": true,
58 | "no-debugger": true,
59 | "no-duplicate-super": true,
60 | "no-empty": false,
61 | "no-empty-interface": true,
62 | "no-eval": true,
63 | "no-inferrable-types": [
64 | true,
65 | "ignore-params"
66 | ],
67 | "no-misused-new": true,
68 | "no-non-null-assertion": true,
69 | "no-shadowed-variable": true,
70 | "no-string-literal": false,
71 | "no-string-throw": true,
72 | "no-switch-case-fall-through": true,
73 | "no-trailing-whitespace": true,
74 | "no-unnecessary-initializer": true,
75 | "no-unused-expression": true,
76 | "no-use-before-declare": true,
77 | "no-var-keyword": true,
78 | "object-literal-sort-keys": false,
79 | "one-line": [
80 | true,
81 | "check-open-brace",
82 | "check-catch",
83 | "check-else",
84 | "check-whitespace"
85 | ],
86 | "prefer-const": true,
87 | "quotemark": [
88 | true,
89 | "single"
90 | ],
91 | "radix": true,
92 | "semicolon": [
93 | true,
94 | "always"
95 | ],
96 | "triple-equals": [
97 | true,
98 | "allow-null-check"
99 | ],
100 | "typedef-whitespace": [
101 | true,
102 | {
103 | "call-signature": "nospace",
104 | "index-signature": "nospace",
105 | "parameter": "nospace",
106 | "property-declaration": "nospace",
107 | "variable-declaration": "nospace"
108 | }
109 | ],
110 | "typeof-compare": true,
111 | "unified-signatures": true,
112 | "variable-name": false,
113 | "whitespace": [
114 | true,
115 | "check-branch",
116 | "check-decl",
117 | "check-operator",
118 | "check-separator",
119 | "check-type"
120 | ],
121 | "directive-selector": [
122 | true,
123 | "attribute",
124 | "app1",
125 | "camelCase"
126 | ],
127 | "component-selector": [
128 | true,
129 | "element",
130 | "app1",
131 | "kebab-case"
132 | ],
133 | "no-output-on-prefix": true,
134 | "use-input-property-decorator": true,
135 | "use-output-property-decorator": true,
136 | "use-host-property-decorator": true,
137 | "no-input-rename": true,
138 | "no-output-rename": true,
139 | "use-life-cycle-interface": true,
140 | "use-pipe-transform-interface": true,
141 | "component-class-suffix": true,
142 | "directive-class-suffix": true
143 | }
144 | }
145 |
--------------------------------------------------------------------------------
/apps/help/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rulesDirectory": [
3 | "node_modules/codelyzer"
4 | ],
5 | "rules": {
6 | "arrow-return-shorthand": true,
7 | "callable-types": true,
8 | "class-name": true,
9 | "comment-format": [
10 | true,
11 | "check-space"
12 | ],
13 | "curly": true,
14 | "deprecation": {
15 | "severity": "warn"
16 | },
17 | "eofline": true,
18 | "forin": true,
19 | "import-blacklist": [
20 | true,
21 | "rxjs",
22 | "rxjs/Rx"
23 | ],
24 | "import-spacing": true,
25 | "indent": [
26 | true,
27 | "spaces"
28 | ],
29 | "interface-over-type-literal": true,
30 | "label-position": true,
31 | "max-line-length": [
32 | true,
33 | 140
34 | ],
35 | "member-access": false,
36 | "member-ordering": [
37 | true,
38 | {
39 | "order": [
40 | "static-field",
41 | "instance-field",
42 | "static-method",
43 | "instance-method"
44 | ]
45 | }
46 | ],
47 | "no-arg": true,
48 | "no-bitwise": true,
49 | "no-console": [
50 | true,
51 | "debug",
52 | "info",
53 | "time",
54 | "timeEnd",
55 | "trace"
56 | ],
57 | "no-construct": true,
58 | "no-debugger": true,
59 | "no-duplicate-super": true,
60 | "no-empty": false,
61 | "no-empty-interface": true,
62 | "no-eval": true,
63 | "no-inferrable-types": [
64 | true,
65 | "ignore-params"
66 | ],
67 | "no-misused-new": true,
68 | "no-non-null-assertion": true,
69 | "no-shadowed-variable": true,
70 | "no-string-literal": false,
71 | "no-string-throw": true,
72 | "no-switch-case-fall-through": true,
73 | "no-trailing-whitespace": true,
74 | "no-unnecessary-initializer": true,
75 | "no-unused-expression": true,
76 | "no-use-before-declare": true,
77 | "no-var-keyword": true,
78 | "object-literal-sort-keys": false,
79 | "one-line": [
80 | true,
81 | "check-open-brace",
82 | "check-catch",
83 | "check-else",
84 | "check-whitespace"
85 | ],
86 | "prefer-const": true,
87 | "quotemark": [
88 | true,
89 | "single"
90 | ],
91 | "radix": true,
92 | "semicolon": [
93 | true,
94 | "always"
95 | ],
96 | "triple-equals": [
97 | true,
98 | "allow-null-check"
99 | ],
100 | "typedef-whitespace": [
101 | true,
102 | {
103 | "call-signature": "nospace",
104 | "index-signature": "nospace",
105 | "parameter": "nospace",
106 | "property-declaration": "nospace",
107 | "variable-declaration": "nospace"
108 | }
109 | ],
110 | "typeof-compare": true,
111 | "unified-signatures": true,
112 | "variable-name": false,
113 | "whitespace": [
114 | true,
115 | "check-branch",
116 | "check-decl",
117 | "check-operator",
118 | "check-separator",
119 | "check-type"
120 | ],
121 | "directive-selector": [
122 | true,
123 | "attribute",
124 | "help",
125 | "camelCase"
126 | ],
127 | "component-selector": [
128 | true,
129 | "element",
130 | "help",
131 | "kebab-case"
132 | ],
133 | "no-output-on-prefix": true,
134 | "use-input-property-decorator": true,
135 | "use-output-property-decorator": true,
136 | "use-host-property-decorator": true,
137 | "no-input-rename": true,
138 | "no-output-rename": true,
139 | "use-life-cycle-interface": true,
140 | "use-pipe-transform-interface": true,
141 | "component-class-suffix": true,
142 | "directive-class-suffix": true
143 | }
144 | }
145 |
--------------------------------------------------------------------------------
/apps/home/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rulesDirectory": [
3 | "node_modules/codelyzer"
4 | ],
5 | "rules": {
6 | "arrow-return-shorthand": true,
7 | "callable-types": true,
8 | "class-name": true,
9 | "comment-format": [
10 | true,
11 | "check-space"
12 | ],
13 | "curly": true,
14 | "deprecation": {
15 | "severity": "warn"
16 | },
17 | "eofline": true,
18 | "forin": true,
19 | "import-blacklist": [
20 | true,
21 | "rxjs",
22 | "rxjs/Rx"
23 | ],
24 | "import-spacing": true,
25 | "indent": [
26 | true,
27 | "spaces"
28 | ],
29 | "interface-over-type-literal": true,
30 | "label-position": true,
31 | "max-line-length": [
32 | true,
33 | 140
34 | ],
35 | "member-access": false,
36 | "member-ordering": [
37 | true,
38 | {
39 | "order": [
40 | "static-field",
41 | "instance-field",
42 | "static-method",
43 | "instance-method"
44 | ]
45 | }
46 | ],
47 | "no-arg": true,
48 | "no-bitwise": true,
49 | "no-console": [
50 | true,
51 | "debug",
52 | "info",
53 | "time",
54 | "timeEnd",
55 | "trace"
56 | ],
57 | "no-construct": true,
58 | "no-debugger": true,
59 | "no-duplicate-super": true,
60 | "no-empty": false,
61 | "no-empty-interface": true,
62 | "no-eval": true,
63 | "no-inferrable-types": [
64 | true,
65 | "ignore-params"
66 | ],
67 | "no-misused-new": true,
68 | "no-non-null-assertion": true,
69 | "no-shadowed-variable": true,
70 | "no-string-literal": false,
71 | "no-string-throw": true,
72 | "no-switch-case-fall-through": true,
73 | "no-trailing-whitespace": true,
74 | "no-unnecessary-initializer": true,
75 | "no-unused-expression": true,
76 | "no-use-before-declare": true,
77 | "no-var-keyword": true,
78 | "object-literal-sort-keys": false,
79 | "one-line": [
80 | true,
81 | "check-open-brace",
82 | "check-catch",
83 | "check-else",
84 | "check-whitespace"
85 | ],
86 | "prefer-const": true,
87 | "quotemark": [
88 | true,
89 | "single"
90 | ],
91 | "radix": true,
92 | "semicolon": [
93 | true,
94 | "always"
95 | ],
96 | "triple-equals": [
97 | true,
98 | "allow-null-check"
99 | ],
100 | "typedef-whitespace": [
101 | true,
102 | {
103 | "call-signature": "nospace",
104 | "index-signature": "nospace",
105 | "parameter": "nospace",
106 | "property-declaration": "nospace",
107 | "variable-declaration": "nospace"
108 | }
109 | ],
110 | "typeof-compare": true,
111 | "unified-signatures": true,
112 | "variable-name": false,
113 | "whitespace": [
114 | true,
115 | "check-branch",
116 | "check-decl",
117 | "check-operator",
118 | "check-separator",
119 | "check-type"
120 | ],
121 | "directive-selector": [
122 | true,
123 | "attribute",
124 | "home",
125 | "camelCase"
126 | ],
127 | "component-selector": [
128 | true,
129 | "element",
130 | "home",
131 | "kebab-case"
132 | ],
133 | "no-output-on-prefix": true,
134 | "use-input-property-decorator": true,
135 | "use-output-property-decorator": true,
136 | "use-host-property-decorator": true,
137 | "no-input-rename": true,
138 | "no-output-rename": true,
139 | "use-life-cycle-interface": true,
140 | "use-pipe-transform-interface": true,
141 | "component-class-suffix": true,
142 | "directive-class-suffix": true
143 | }
144 | }
145 |
--------------------------------------------------------------------------------
/apps/menu/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rulesDirectory": [
3 | "node_modules/codelyzer"
4 | ],
5 | "rules": {
6 | "arrow-return-shorthand": true,
7 | "callable-types": true,
8 | "class-name": true,
9 | "comment-format": [
10 | true,
11 | "check-space"
12 | ],
13 | "curly": true,
14 | "deprecation": {
15 | "severity": "warn"
16 | },
17 | "eofline": true,
18 | "forin": true,
19 | "import-blacklist": [
20 | true,
21 | "rxjs",
22 | "rxjs/Rx"
23 | ],
24 | "import-spacing": true,
25 | "indent": [
26 | true,
27 | "spaces"
28 | ],
29 | "interface-over-type-literal": true,
30 | "label-position": true,
31 | "max-line-length": [
32 | true,
33 | 140
34 | ],
35 | "member-access": false,
36 | "member-ordering": [
37 | true,
38 | {
39 | "order": [
40 | "static-field",
41 | "instance-field",
42 | "static-method",
43 | "instance-method"
44 | ]
45 | }
46 | ],
47 | "no-arg": true,
48 | "no-bitwise": true,
49 | "no-console": [
50 | true,
51 | "debug",
52 | "info",
53 | "time",
54 | "timeEnd",
55 | "trace"
56 | ],
57 | "no-construct": true,
58 | "no-debugger": true,
59 | "no-duplicate-super": true,
60 | "no-empty": false,
61 | "no-empty-interface": true,
62 | "no-eval": true,
63 | "no-inferrable-types": [
64 | true,
65 | "ignore-params"
66 | ],
67 | "no-misused-new": true,
68 | "no-non-null-assertion": true,
69 | "no-shadowed-variable": true,
70 | "no-string-literal": false,
71 | "no-string-throw": true,
72 | "no-switch-case-fall-through": true,
73 | "no-trailing-whitespace": true,
74 | "no-unnecessary-initializer": true,
75 | "no-unused-expression": true,
76 | "no-use-before-declare": true,
77 | "no-var-keyword": true,
78 | "object-literal-sort-keys": false,
79 | "one-line": [
80 | true,
81 | "check-open-brace",
82 | "check-catch",
83 | "check-else",
84 | "check-whitespace"
85 | ],
86 | "prefer-const": true,
87 | "quotemark": [
88 | true,
89 | "single"
90 | ],
91 | "radix": true,
92 | "semicolon": [
93 | true,
94 | "always"
95 | ],
96 | "triple-equals": [
97 | true,
98 | "allow-null-check"
99 | ],
100 | "typedef-whitespace": [
101 | true,
102 | {
103 | "call-signature": "nospace",
104 | "index-signature": "nospace",
105 | "parameter": "nospace",
106 | "property-declaration": "nospace",
107 | "variable-declaration": "nospace"
108 | }
109 | ],
110 | "typeof-compare": true,
111 | "unified-signatures": true,
112 | "variable-name": false,
113 | "whitespace": [
114 | true,
115 | "check-branch",
116 | "check-decl",
117 | "check-operator",
118 | "check-separator",
119 | "check-type"
120 | ],
121 | "directive-selector": [
122 | true,
123 | "attribute",
124 | "menu",
125 | "camelCase"
126 | ],
127 | "component-selector": [
128 | true,
129 | "element",
130 | "menu",
131 | "kebab-case"
132 | ],
133 | "no-output-on-prefix": true,
134 | "use-input-property-decorator": true,
135 | "use-output-property-decorator": true,
136 | "use-host-property-decorator": true,
137 | "no-input-rename": true,
138 | "no-output-rename": true,
139 | "use-life-cycle-interface": true,
140 | "use-pipe-transform-interface": true,
141 | "component-class-suffix": true,
142 | "directive-class-suffix": true
143 | }
144 | }
145 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # single-spa-examples for single-spa-angular-cli
2 |
3 | ## Single SPA
4 | [single-spa demo](https://single-spa.surge.sh)
5 | [single-spa](https://github.com/joeldenning/single-spa)
6 | [simple-single-spa-webpack-example](https://github.com/joeldenning/simple-single-spa-webpack-example)
7 |
8 | # Single SPA for Angular CLI
9 |
10 | ## View the demo!
11 | A [demo is live](http://single-spa.surge.sh) on surge.sh.
12 |
13 | ## This project is an Angular 5 portal as microfrontend lazy loaded thanks to the CLI
14 |
15 | The npm project is based on [single-spa-angular-cli](https://www.npmjs.com/package/single-spa-angular-cli)
16 |
17 | ## View the Single SPA Angular CLI portal demo
18 | A [demo is live](http://single-spa-angular-cli.placeme.io) on placeme.io (comming soon).
19 |
20 | ## How to get the examples running locally
21 | ```bash
22 | git clone git@github.com:PlaceMe-SAS/single-spa-angular-cli-examples.git
23 | cd single-spa-angular-cli-examples
24 | npm install -g @angular/cli
25 | npm install
26 | npm run ng:build
27 | npm start
28 | ```
29 | That's all!
30 |
31 | ## How to perform CI tasks
32 | ```bash
33 | npm run ng:lint
34 | npm run ng:test
35 | ```
36 | That's all!
37 |
38 | ## Want to debug your app ?
39 | ### Serve your angular app project for developement mode
40 | ```bash
41 | cd apps/home
42 | ng serve --port=4201
43 | ```
44 | open http://localhost:4201
45 |
46 | ### Configure a proxy to use the cli dev mode app
47 | ```js
48 | // webpack.config.js
49 |
50 | const devApplications = {
51 | //menu: 'http://localhost:4200',
52 | home: 'http://localhost:4201',
53 | //app1: 'http://localhost:4202',
54 | //help: 'http://localhost:4203'
55 | };
56 | ...
57 | ```
58 |
59 | ## Want to build Apps
60 | ### Build single application
61 | ```bash
62 | cd apps/home
63 | ng build --prod -op ../../build/home
64 | ```
65 |
66 | ### Build all applications
67 | ```bash
68 | npm run ng:build
69 | npm run build (comming soon)
70 | ```
71 |
72 | ## Add an Angular CLI apps
73 | ### Create Angular CLI standard app
74 | ```bash
75 | cd apps
76 | ng new app1 --prefix=app1
77 | cd app1
78 | ng serve --port=4202
79 | ```
80 | open http://localhost:4202
81 |
82 | ### Remove Zone.js from the cli app bundle
83 | ```js
84 | // app1/src/polyfills.ts
85 |
86 | // Comment zone.js, it is globaly imported by the portal
87 | // import 'zone.js/dist/zone'; // Included with Angular CLI.
88 | ```
89 |
90 | ### Add Zone.js only for the cli app
91 | ```html
92 |
93 |
94 |
95 |
96 |