Skip to content

Commit eb6ad85

Browse files
committed
Setting up angular-image-annotator project
1 parent 77f3b19 commit eb6ad85

38 files changed

+4013
-98
lines changed

angular.json

Lines changed: 165 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,169 @@
22
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
33
"version": 1,
44
"newProjectRoot": "projects",
5-
"projects": {}
5+
"projects": {
6+
"aia-lib": {
7+
"root": "projects/aia-lib",
8+
"sourceRoot": "projects/aia-lib/src",
9+
"projectType": "library",
10+
"prefix": "aia",
11+
"architect": {
12+
"build": {
13+
"builder": "@angular-devkit/build-ng-packagr:build",
14+
"options": {
15+
"tsConfig": "projects/aia-lib/tsconfig.lib.json",
16+
"project": "projects/aia-lib/ng-package.json"
17+
}
18+
},
19+
"test": {
20+
"builder": "@angular-devkit/build-angular:karma",
21+
"options": {
22+
"main": "projects/aia-lib/src/test.ts",
23+
"tsConfig": "projects/aia-lib/tsconfig.spec.json",
24+
"karmaConfig": "projects/aia-lib/karma.conf.js"
25+
}
26+
},
27+
"lint": {
28+
"builder": "@angular-devkit/build-angular:tslint",
29+
"options": {
30+
"tsConfig": [
31+
"projects/aia-lib/tsconfig.lib.json",
32+
"projects/aia-lib/tsconfig.spec.json"
33+
],
34+
"exclude": [
35+
"**/node_modules/**"
36+
]
37+
}
38+
}
39+
}
40+
},
41+
"aia-tester": {
42+
"root": "projects/aia-tester/",
43+
"sourceRoot": "projects/aia-tester/src",
44+
"projectType": "application",
45+
"prefix": "app",
46+
"schematics": {},
47+
"architect": {
48+
"build": {
49+
"builder": "@angular-devkit/build-angular:browser",
50+
"options": {
51+
"outputPath": "dist/aia-tester",
52+
"index": "projects/aia-tester/src/index.html",
53+
"main": "projects/aia-tester/src/main.ts",
54+
"polyfills": "projects/aia-tester/src/polyfills.ts",
55+
"tsConfig": "projects/aia-tester/tsconfig.app.json",
56+
"assets": [
57+
"projects/aia-tester/src/favicon.ico",
58+
"projects/aia-tester/src/assets"
59+
],
60+
"styles": [
61+
"projects/aia-tester/src/styles.css"
62+
],
63+
"scripts": []
64+
},
65+
"configurations": {
66+
"production": {
67+
"fileReplacements": [
68+
{
69+
"replace": "projects/aia-tester/src/environments/environment.ts",
70+
"with": "projects/aia-tester/src/environments/environment.prod.ts"
71+
}
72+
],
73+
"optimization": true,
74+
"outputHashing": "all",
75+
"sourceMap": false,
76+
"extractCss": true,
77+
"namedChunks": false,
78+
"aot": true,
79+
"extractLicenses": true,
80+
"vendorChunk": false,
81+
"buildOptimizer": true,
82+
"budgets": [
83+
{
84+
"type": "initial",
85+
"maximumWarning": "2mb",
86+
"maximumError": "5mb"
87+
}
88+
]
89+
}
90+
}
91+
},
92+
"serve": {
93+
"builder": "@angular-devkit/build-angular:dev-server",
94+
"options": {
95+
"browserTarget": "aia-tester:build"
96+
},
97+
"configurations": {
98+
"production": {
99+
"browserTarget": "aia-tester:build:production"
100+
}
101+
}
102+
},
103+
"extract-i18n": {
104+
"builder": "@angular-devkit/build-angular:extract-i18n",
105+
"options": {
106+
"browserTarget": "aia-tester:build"
107+
}
108+
},
109+
"test": {
110+
"builder": "@angular-devkit/build-angular:karma",
111+
"options": {
112+
"main": "projects/aia-tester/src/test.ts",
113+
"polyfills": "projects/aia-tester/src/polyfills.ts",
114+
"tsConfig": "projects/aia-tester/tsconfig.spec.json",
115+
"karmaConfig": "projects/aia-tester/karma.conf.js",
116+
"styles": [
117+
"projects/aia-tester/src/styles.css"
118+
],
119+
"scripts": [],
120+
"assets": [
121+
"projects/aia-tester/src/favicon.ico",
122+
"projects/aia-tester/src/assets"
123+
]
124+
}
125+
},
126+
"lint": {
127+
"builder": "@angular-devkit/build-angular:tslint",
128+
"options": {
129+
"tsConfig": [
130+
"projects/aia-tester/tsconfig.app.json",
131+
"projects/aia-tester/tsconfig.spec.json"
132+
],
133+
"exclude": [
134+
"**/node_modules/**"
135+
]
136+
}
137+
}
138+
}
139+
},
140+
"aia-tester-e2e": {
141+
"root": "projects/aia-tester-e2e/",
142+
"projectType": "application",
143+
"prefix": "",
144+
"architect": {
145+
"e2e": {
146+
"builder": "@angular-devkit/build-angular:protractor",
147+
"options": {
148+
"protractorConfig": "projects/aia-tester-e2e/protractor.conf.js",
149+
"devServerTarget": "aia-tester:serve"
150+
},
151+
"configurations": {
152+
"production": {
153+
"devServerTarget": "aia-tester:serve:production"
154+
}
155+
}
156+
},
157+
"lint": {
158+
"builder": "@angular-devkit/build-angular:tslint",
159+
"options": {
160+
"tsConfig": "projects/aia-tester-e2e/tsconfig.e2e.json",
161+
"exclude": [
162+
"**/node_modules/**"
163+
]
164+
}
165+
}
166+
}
167+
}
168+
},
169+
"defaultProject": "aia-lib"
6170
}

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
"zone.js": "~0.8.26"
2626
},
2727
"devDependencies": {
28+
"@angular-devkit/build-angular": "~0.11.0",
29+
"@angular-devkit/build-ng-packagr": "~0.11.0",
2830
"@angular/cli": "~7.1.3",
2931
"@angular/compiler-cli": "~7.1.0",
3032
"@angular/language-service": "~7.1.0",
@@ -39,8 +41,11 @@
3941
"karma-coverage-istanbul-reporter": "~2.0.1",
4042
"karma-jasmine": "~1.1.2",
4143
"karma-jasmine-html-reporter": "^0.2.2",
44+
"ng-packagr": "^4.2.0",
4245
"protractor": "~5.4.0",
4346
"ts-node": "~7.0.0",
47+
"tsickle": ">=0.29.0",
48+
"tslib": "^1.9.0",
4449
"tslint": "~5.11.0",
4550
"typescript": "~3.1.6"
4651
}

projects/aia-lib/karma.conf.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-chrome-launcher'),
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage-istanbul-reporter'),
13+
require('@angular-devkit/build-angular/plugins/karma')
14+
],
15+
client: {
16+
clearContext: false // leave Jasmine Spec Runner output visible in browser
17+
},
18+
coverageIstanbulReporter: {
19+
dir: require('path').join(__dirname, '../../coverage'),
20+
reports: ['html', 'lcovonly'],
21+
fixWebpackSourcePaths: true
22+
},
23+
reporters: ['progress', 'kjhtml'],
24+
port: 9876,
25+
colors: true,
26+
logLevel: config.LOG_INFO,
27+
autoWatch: true,
28+
browsers: ['Chrome'],
29+
singleRun: false
30+
});
31+
};

projects/aia-lib/ng-package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3+
"dest": "../../dist/aia-lib",
4+
"lib": {
5+
"entryFile": "src/public_api.ts"
6+
}
7+
}

projects/aia-lib/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "aia-lib",
3+
"version": "0.0.1",
4+
"peerDependencies": {
5+
"@angular/common": "^7.1.0",
6+
"@angular/core": "^7.1.0"
7+
}
8+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { NgModule } from '@angular/core';
2+
import { AiaImageAnnotatorComponent } from './components/aia-image-annotator.component';
3+
4+
@NgModule({
5+
declarations: [AiaImageAnnotatorComponent],
6+
imports: [
7+
],
8+
exports: [AiaImageAnnotatorComponent]
9+
})
10+
export class AiaLibModule { }
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { AiaImageAnnotatorComponent } from './aia-image-annotator.component';
4+
5+
describe('AiaImageAnnotatorComponent', () => {
6+
let component: AiaImageAnnotatorComponent;
7+
let fixture: ComponentFixture<AiaImageAnnotatorComponent>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [ AiaImageAnnotatorComponent ]
12+
})
13+
.compileComponents();
14+
}));
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(AiaImageAnnotatorComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'aia-image-annotator',
5+
template: `
6+
<p>
7+
aia-lib works!!!!
8+
</p>
9+
`,
10+
styles: []
11+
})
12+
export class AiaImageAnnotatorComponent implements OnInit {
13+
14+
constructor() { }
15+
16+
ngOnInit() {
17+
}
18+
19+
}

projects/aia-lib/src/public_api.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/*
2+
* Public API Surface of aia-lib
3+
*/
4+
5+
export * from './lib/components/aia-image-annotator.component';
6+
export * from './lib/aia-lib.module';

projects/aia-lib/src/test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
2+
3+
import 'core-js/es7/reflect';
4+
import 'zone.js/dist/zone';
5+
import 'zone.js/dist/zone-testing';
6+
import { getTestBed } from '@angular/core/testing';
7+
import {
8+
BrowserDynamicTestingModule,
9+
platformBrowserDynamicTesting
10+
} from '@angular/platform-browser-dynamic/testing';
11+
12+
declare const require: any;
13+
14+
// First, initialize the Angular testing environment.
15+
getTestBed().initTestEnvironment(
16+
BrowserDynamicTestingModule,
17+
platformBrowserDynamicTesting()
18+
);
19+
// Then we find all the tests.
20+
const context = require.context('./', true, /\.spec\.ts$/);
21+
// And load the modules.
22+
context.keys().map(context);

projects/aia-lib/tsconfig.lib.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../out-tsc/lib",
5+
"target": "es2015",
6+
"module": "es2015",
7+
"moduleResolution": "node",
8+
"declaration": true,
9+
"sourceMap": true,
10+
"inlineSources": true,
11+
"emitDecoratorMetadata": true,
12+
"experimentalDecorators": true,
13+
"importHelpers": true,
14+
"types": [],
15+
"lib": [
16+
"dom",
17+
"es2018"
18+
]
19+
},
20+
"angularCompilerOptions": {
21+
"annotateForClosureCompiler": true,
22+
"skipTemplateCodegen": true,
23+
"strictMetadataEmit": true,
24+
"fullTemplateTypeCheck": true,
25+
"strictInjectionParameters": true,
26+
"enableResourceInlining": true
27+
},
28+
"exclude": [
29+
"src/test.ts",
30+
"**/*.spec.ts"
31+
]
32+
}

projects/aia-lib/tsconfig.spec.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../out-tsc/spec",
5+
"types": [
6+
"jasmine",
7+
"node"
8+
]
9+
},
10+
"files": [
11+
"src/test.ts"
12+
],
13+
"include": [
14+
"**/*.spec.ts",
15+
"**/*.d.ts"
16+
]
17+
}

projects/aia-lib/tslint.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": "../../tslint.json",
3+
"rules": {
4+
"directive-selector": [
5+
true,
6+
"attribute",
7+
"aia",
8+
"camelCase"
9+
],
10+
"component-selector": [
11+
true,
12+
"element",
13+
"aia",
14+
"kebab-case"
15+
]
16+
}
17+
}

0 commit comments

Comments
 (0)