Skip to content

Commit 5bee612

Browse files
committed
init
0 parents  commit 5bee612

37 files changed

+1019
-0
lines changed

.gitignore

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
**/.rpt2_cache
8+
9+
# dependencies
10+
**/node_modules
11+
**/package-lock.json
12+
13+
# IDEs and editors
14+
/.idea
15+
.project
16+
.classpath
17+
.c9/
18+
*.launch
19+
.settings/
20+
*.sublime-workspace
21+
22+
# IDE - VSCode
23+
.vscode/*
24+
!.vscode/settings.json
25+
!.vscode/tasks.json
26+
!.vscode/launch.json
27+
!.vscode/extensions.json
28+
29+
# misc
30+
/.sass-cache
31+
/connect.lock
32+
/coverage
33+
/libpeerconnection.log
34+
npm-debug.log
35+
yarn-error.log
36+
testem.log
37+
/typings
38+
39+
# System Files
40+
.DS_Store
41+
Thumbs.db

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Angular Plugin Architecture Example
2+
# Article related:
3+
4+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.1.4.
5+
6+
This project represents an example of how to achieve a plugin architecture in angular.
7+
8+
> cd plugins/plugin-a
9+
> npm install
10+
> npm run build
11+
12+
> cd core-app
13+
> npm install
14+
> npm start

core-app/.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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

core-app/angular.json

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"core-app": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "application",
10+
"prefix": "app",
11+
"schematics": {},
12+
"architect": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:browser",
15+
"options": {
16+
"outputPath": "dist/core-app",
17+
"index": "src/index.html",
18+
"main": "src/main.ts",
19+
"polyfills": "src/polyfills.ts",
20+
"tsConfig": "src/tsconfig.app.json",
21+
"assets": [
22+
"src/favicon.ico",
23+
"src/assets"
24+
],
25+
"styles": [
26+
"src/styles.css"
27+
],
28+
"scripts": [
29+
"./node_modules/systemjs/dist/system.js"
30+
]
31+
},
32+
"configurations": {
33+
"production": {
34+
"fileReplacements": [
35+
{
36+
"replace": "src/environments/environment.ts",
37+
"with": "src/environments/environment.prod.ts"
38+
}
39+
],
40+
"optimization": true,
41+
"outputHashing": "all",
42+
"sourceMap": false,
43+
"extractCss": true,
44+
"namedChunks": false,
45+
"aot": true,
46+
"extractLicenses": true,
47+
"vendorChunk": false,
48+
"buildOptimizer": true
49+
}
50+
}
51+
},
52+
"serve": {
53+
"builder": "@angular-devkit/build-angular:dev-server",
54+
"options": {
55+
"browserTarget": "core-app:build"
56+
},
57+
"configurations": {
58+
"production": {
59+
"browserTarget": "core-app:build:production"
60+
}
61+
}
62+
},
63+
"extract-i18n": {
64+
"builder": "@angular-devkit/build-angular:extract-i18n",
65+
"options": {
66+
"browserTarget": "core-app:build"
67+
}
68+
},
69+
"test": {
70+
"builder": "@angular-devkit/build-angular:karma",
71+
"options": {
72+
"main": "src/test.ts",
73+
"polyfills": "src/polyfills.ts",
74+
"tsConfig": "src/tsconfig.spec.json",
75+
"karmaConfig": "src/karma.conf.js",
76+
"styles": [
77+
"src/styles.css"
78+
],
79+
"scripts": [],
80+
"assets": [
81+
"src/favicon.ico",
82+
"src/assets"
83+
]
84+
}
85+
},
86+
"lint": {
87+
"builder": "@angular-devkit/build-angular:tslint",
88+
"options": {
89+
"tsConfig": [
90+
"src/tsconfig.app.json",
91+
"src/tsconfig.spec.json"
92+
],
93+
"exclude": [
94+
"**/node_modules/**"
95+
]
96+
}
97+
}
98+
}
99+
},
100+
"core-app-e2e": {
101+
"root": "e2e/",
102+
"projectType": "application",
103+
"architect": {
104+
"e2e": {
105+
"builder": "@angular-devkit/build-angular:protractor",
106+
"options": {
107+
"protractorConfig": "e2e/protractor.conf.js",
108+
"devServerTarget": "core-app:serve"
109+
},
110+
"configurations": {
111+
"production": {
112+
"devServerTarget": "core-app:serve:production"
113+
}
114+
}
115+
},
116+
"lint": {
117+
"builder": "@angular-devkit/build-angular:tslint",
118+
"options": {
119+
"tsConfig": "e2e/tsconfig.e2e.json",
120+
"exclude": [
121+
"**/node_modules/**"
122+
]
123+
}
124+
}
125+
}
126+
}
127+
},
128+
"defaultProject": "core-app"
129+
}

core-app/e2e/protractor.conf.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Protractor configuration file, see link for more information
2+
// https://github.com/angular/protractor/blob/master/lib/config.ts
3+
4+
const { SpecReporter } = require('jasmine-spec-reporter');
5+
6+
exports.config = {
7+
allScriptsTimeout: 11000,
8+
specs: [
9+
'./src/**/*.e2e-spec.ts'
10+
],
11+
capabilities: {
12+
'browserName': 'chrome'
13+
},
14+
directConnect: true,
15+
baseUrl: 'http://localhost:4200/',
16+
framework: 'jasmine',
17+
jasmineNodeOpts: {
18+
showColors: true,
19+
defaultTimeoutInterval: 30000,
20+
print: function() {}
21+
},
22+
onPrepare() {
23+
require('ts-node').register({
24+
project: require('path').join(__dirname, './tsconfig.e2e.json')
25+
});
26+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27+
}
28+
};

core-app/e2e/src/app.e2e-spec.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { AppPage } from './app.po';
2+
3+
describe('workspace-project 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 core-app!');
13+
});
14+
});

core-app/e2e/src/app.po.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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('app-root h1')).getText();
10+
}
11+
}

core-app/e2e/tsconfig.e2e.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/app",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"types": [
8+
"jasmine",
9+
"jasminewd2",
10+
"node"
11+
]
12+
}
13+
}

core-app/package.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "core-app",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"ng": "ng",
6+
"start": "ng serve",
7+
"build": "ng build",
8+
"test": "ng test",
9+
"lint": "ng lint",
10+
"e2e": "ng e2e"
11+
},
12+
"private": true,
13+
"dependencies": {
14+
"@angular/animations": "^6.1.0",
15+
"@angular/common": "^6.1.0",
16+
"@angular/compiler": "^6.1.0",
17+
"@angular/core": "^6.1.0",
18+
"@angular/forms": "^6.1.0",
19+
"@angular/http": "^6.1.0",
20+
"@angular/platform-browser": "^6.1.0",
21+
"@angular/platform-browser-dynamic": "^6.1.0",
22+
"@angular/router": "^6.1.0",
23+
"core-js": "^2.5.4",
24+
"rxjs": "^6.0.0",
25+
"systemjs": "^0.21.4",
26+
"zone.js": "~0.8.26"
27+
},
28+
"devDependencies": {
29+
"@angular-devkit/build-angular": "~0.7.0",
30+
"@angular/cli": "~6.1.4",
31+
"@angular/compiler-cli": "^6.1.0",
32+
"@angular/language-service": "^6.1.0",
33+
"@types/jasmine": "~2.8.6",
34+
"@types/jasminewd2": "~2.0.3",
35+
"@types/node": "~8.9.4",
36+
"codelyzer": "~4.2.1",
37+
"jasmine-core": "~2.99.1",
38+
"jasmine-spec-reporter": "~4.2.1",
39+
"karma": "~1.7.1",
40+
"karma-chrome-launcher": "~2.2.0",
41+
"karma-coverage-istanbul-reporter": "~2.0.0",
42+
"karma-jasmine": "~1.1.1",
43+
"karma-jasmine-html-reporter": "^0.2.2",
44+
"protractor": "~5.4.0",
45+
"ts-node": "~5.0.1",
46+
"tslint": "~5.9.1",
47+
"typescript": "~2.7.2"
48+
}
49+
}

core-app/src/app/app.component.css

Whitespace-only changes.

core-app/src/app/app.component.html

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!--The content below is only a placeholder and can be replaced.-->
2+
<div style="text-align:center">
3+
<h1>
4+
Welcome to {{ title }}!
5+
</h1>
6+
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
7+
</div>
8+
<h2>Here are some links to help you start: </h2>
9+
<ul>
10+
<li>
11+
<h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
12+
</li>
13+
<li>
14+
<h2><a target="_blank" rel="noopener" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
15+
</li>
16+
<li>
17+
<h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
18+
</li>
19+
</ul>
20+
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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 'core-app'`, async(() => {
17+
const fixture = TestBed.createComponent(AppComponent);
18+
const app = fixture.debugElement.componentInstance;
19+
expect(app.title).toEqual('core-app');
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 core-app!');
26+
}));
27+
});

0 commit comments

Comments
 (0)