mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Added external library to the project
This commit is contained in:
34
angular.json
34
angular.json
@@ -1566,6 +1566,40 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"external": {
|
||||
"projectType": "library",
|
||||
"root": "apps/external",
|
||||
"sourceRoot": "apps/external",
|
||||
"prefix": "lib",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||
"options": {
|
||||
"project": "apps/external/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/external/tsconfig.lib.prod.json"
|
||||
},
|
||||
"development": {
|
||||
"tsConfig": "apps/external/tsconfig.lib.json"
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "production"
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"tsConfig": "apps/external/tsconfig.spec.json",
|
||||
"karmaConfig": "karma.conf.js",
|
||||
"polyfills": [
|
||||
"zone.js",
|
||||
"zone.js/testing"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
25
apps/external/README.md
vendored
Normal file
25
apps/external/README.md
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
# External
|
||||
|
||||
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.0.0.
|
||||
|
||||
## Code scaffolding
|
||||
|
||||
Run `ng generate component component-name --project external` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project external`.
|
||||
|
||||
> Note: Don't forget to add `--project external` or else it will be added to the default project in your `angular.json` file.
|
||||
|
||||
## Build
|
||||
|
||||
Run `ng build external` to build the project. The build artifacts will be stored in the `dist/` directory.
|
||||
|
||||
## Publishing
|
||||
|
||||
After building your library with `ng build external`, go to the dist folder `cd dist/external` and run `npm publish`.
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `ng test external` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
||||
|
||||
## Further help
|
||||
|
||||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
||||
7
apps/external/ng-package.json
vendored
Normal file
7
apps/external/ng-package.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
|
||||
"dest": "../../dist/external",
|
||||
"lib": {
|
||||
"entryFile": "src/public-api.ts"
|
||||
}
|
||||
}
|
||||
6
apps/external/openstreetmap/ng-package.json
vendored
Normal file
6
apps/external/openstreetmap/ng-package.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "../../../../node_modules/ng-packagr/ng-package.schema.json",
|
||||
"lib": {
|
||||
"entryFile": "src/public-api.ts"
|
||||
}
|
||||
}
|
||||
1
apps/external/openstreetmap/src/lib/defs/index.ts
vendored
Normal file
1
apps/external/openstreetmap/src/lib/defs/index.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './place.dto';
|
||||
12
apps/external/openstreetmap/src/lib/defs/place.dto.ts
vendored
Normal file
12
apps/external/openstreetmap/src/lib/defs/place.dto.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* @see https://nominatim.org/release-docs/latest/api/Output/
|
||||
*/
|
||||
export interface PlaceDto {
|
||||
place_id: number;
|
||||
|
||||
lat: string;
|
||||
|
||||
lon: string;
|
||||
|
||||
display_name: string;
|
||||
}
|
||||
8
apps/external/openstreetmap/src/lib/openstreetmap.params.ts
vendored
Normal file
8
apps/external/openstreetmap/src/lib/openstreetmap.params.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export namespace OpenStreetMapParams {
|
||||
export interface Query {
|
||||
q?: string;
|
||||
postalcode?: string;
|
||||
country?: string;
|
||||
limit?: number;
|
||||
}
|
||||
}
|
||||
20
apps/external/openstreetmap/src/lib/openstreetmap.service.ts
vendored
Normal file
20
apps/external/openstreetmap/src/lib/openstreetmap.service.ts
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { OpenStreetMapParams } from './openstreetmap.params';
|
||||
import { PlaceDto } from './defs';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class OpenStreetMap {
|
||||
url = 'https://nominatim.openstreetmap.org/';
|
||||
|
||||
constructor(private httpClient: HttpClient) {}
|
||||
|
||||
query(query: OpenStreetMapParams.Query) {
|
||||
return this.httpClient.get<PlaceDto[]>(`${this.url}search`, {
|
||||
params: {
|
||||
format: 'json',
|
||||
...query,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
3
apps/external/openstreetmap/src/public-api.ts
vendored
Normal file
3
apps/external/openstreetmap/src/public-api.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './lib/openstreetmap.service';
|
||||
export * from './lib/openstreetmap.params';
|
||||
export * from './lib/defs';
|
||||
11
apps/external/package.json
vendored
Normal file
11
apps/external/package.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "external",
|
||||
"version": "0.0.1",
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^15.0.0",
|
||||
"@angular/core": "^15.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
}
|
||||
}
|
||||
22
apps/external/src/lib/external.component.spec.ts
vendored
Normal file
22
apps/external/src/lib/external.component.spec.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ExternalComponent } from './external.component';
|
||||
|
||||
describe('ExternalComponent', () => {
|
||||
let component: ExternalComponent;
|
||||
let fixture: ComponentFixture<ExternalComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ExternalComponent],
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ExternalComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
12
apps/external/src/lib/external.component.ts
vendored
Normal file
12
apps/external/src/lib/external.component.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'lib-external',
|
||||
template: `
|
||||
<p>
|
||||
external works!
|
||||
</p>
|
||||
`,
|
||||
styles: [],
|
||||
})
|
||||
export class ExternalComponent {}
|
||||
9
apps/external/src/lib/external.module.ts
vendored
Normal file
9
apps/external/src/lib/external.module.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { ExternalComponent } from './external.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [ExternalComponent],
|
||||
imports: [],
|
||||
exports: [ExternalComponent],
|
||||
})
|
||||
export class ExternalModule {}
|
||||
16
apps/external/src/lib/external.service.spec.ts
vendored
Normal file
16
apps/external/src/lib/external.service.spec.ts
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ExternalService } from './external.service';
|
||||
|
||||
describe('ExternalService', () => {
|
||||
let service: ExternalService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(ExternalService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
8
apps/external/src/lib/external.service.ts
vendored
Normal file
8
apps/external/src/lib/external.service.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ExternalService {
|
||||
constructor() {}
|
||||
}
|
||||
7
apps/external/src/public-api.ts
vendored
Normal file
7
apps/external/src/public-api.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Public API Surface of external
|
||||
*/
|
||||
|
||||
export * from './lib/external.service';
|
||||
export * from './lib/external.component';
|
||||
export * from './lib/external.module';
|
||||
14
apps/external/tsconfig.lib.json
vendored
Normal file
14
apps/external/tsconfig.lib.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../out-tsc/lib",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"inlineSources": true,
|
||||
"types": []
|
||||
},
|
||||
"exclude": [
|
||||
"**/*.spec.ts"
|
||||
]
|
||||
}
|
||||
10
apps/external/tsconfig.lib.prod.json
vendored
Normal file
10
apps/external/tsconfig.lib.prod.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"compilerOptions": {
|
||||
"declarationMap": false
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"compilationMode": "partial"
|
||||
}
|
||||
}
|
||||
14
apps/external/tsconfig.spec.json
vendored
Normal file
14
apps/external/tsconfig.spec.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../out-tsc/spec",
|
||||
"types": [
|
||||
"jasmine"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
@@ -21,6 +21,7 @@
|
||||
"*test:domain-printer": "ng test @domain/printer",
|
||||
"test:domain-remission": "ng test @domain/remission",
|
||||
"*test:domain-task-calendar": "ng test @domain/task-calendar",
|
||||
"test:external": "ng test external",
|
||||
"*test:hub-notifications": "ng test @hub/notifications",
|
||||
"*test:isa-remission": "ng test @isa/remission",
|
||||
"*test:modal-availabilities": "ng test @modal/availabilities",
|
||||
|
||||
@@ -159,6 +159,12 @@
|
||||
"core": [
|
||||
"dist/core"
|
||||
],
|
||||
"external": [
|
||||
"dist/external"
|
||||
],
|
||||
"@external/*": [
|
||||
"apps/external/*/src/public-api.ts"
|
||||
],
|
||||
"native-container": [
|
||||
"apps/native-container/src/public-api.ts"
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user