diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/lib/api/api-debug.component.ts b/src/lib/api/api-debug.component.ts index 7223ef9bfa99b15fd693881293a5823b207e5ac4..9a11d054463a986c532affa8ecb3bc68b51e0b25 100644 --- a/src/lib/api/api-debug.component.ts +++ b/src/lib/api/api-debug.component.ts @@ -3,8 +3,11 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, + EventEmitter, + Output, } from '@angular/core'; +// TODO injecter import { Configuration } from '../configuration'; import { DebugStateService } from '../debug-state.service'; @@ -26,7 +29,7 @@ interface ResponseInfo { } @Component({ - selector: 'lib-api-debug', + selector: 'app-api-debug', templateUrl: './api-debug.component.html', styleUrls: ['./api-debug.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, @@ -37,6 +40,9 @@ export class ApiDebugComponent { private readonly ids: string[] = []; private readonly apiPrefix: string; + @Output() + public countChanged = new EventEmitter<number>(); + constructor( interceptor: ApiDebugInterceptor, public readonly debug: DebugStateService, @@ -45,7 +51,9 @@ export class ApiDebugComponent { ) { this.apiPrefix = conf.apiBaseURL; - interceptor.events$.subscribe(ev => this.handle(ev)); + interceptor.events$.subscribe(ev => { + this.handle(ev); + }); } public get unseenCount(): number { @@ -82,6 +90,7 @@ export class ApiDebugComponent { private handle(ev: DebugEvent): void { if (ev.type === 'request') { this.addRequest(ev.id, ev.request); + this.countChanged.emit(this.ids.length); this.cd.markForCheck(); return; } @@ -98,7 +107,10 @@ export class ApiDebugComponent { this.cd.markForCheck(); } - private addRequest(id: string, { urlWithParams, method }: HttpRequest<any>): void { + private addRequest( + id: string, + { urlWithParams, method }: HttpRequest<any> + ): void { if (urlWithParams.startsWith(this.apiPrefix)) { urlWithParams = new URL(urlWithParams).pathname; } @@ -113,7 +125,10 @@ export class ApiDebugComponent { this.ids.unshift(id); } - private setResponse(request: RequestInfo, { status, statusText, headers }: HttpResponseBase): void { + private setResponse( + request: RequestInfo, + { status, statusText, headers }: HttpResponseBase + ): void { request.response = { status, statusText, diff --git a/src/lib/api/api-debug.interceptor.ts b/src/lib/api/api-debug.interceptor.ts index c49bac949a4cdd58f4df33d9fafc9d35b72a0b9c..1f38f30ceae792d9e0b40d1099ab0e6710f1c90f 100644 --- a/src/lib/api/api-debug.interceptor.ts +++ b/src/lib/api/api-debug.interceptor.ts @@ -9,6 +9,7 @@ import * as _ from 'lodash'; import { Observable, ReplaySubject } from 'rxjs'; import { finalize, tap } from 'rxjs/operators'; +// TODO injecter import { Configuration } from '../configuration'; export interface RequestDebugEvent { diff --git a/src/lib/api/api.interceptor.spec.ts b/src/lib/api/api.interceptor.spec.ts deleted file mode 100644 index 3162a3d85ca3192e5c66d5acfab0d650dac386f6..0000000000000000000000000000000000000000 --- a/src/lib/api/api.interceptor.spec.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { HttpHandler, HttpRequest } from '@angular/common/http'; -import { inject, TestBed } from '@angular/core/testing'; -import { AppError } from '@devatscience/ngx-errors'; -import { of } from 'rxjs'; -import { catchError } from 'rxjs/operators'; - -import { ApiInterceptor } from './api.interceptor'; -import { Configuration } from '../configuration'; -import { MarbleFormatter, MarbleTestScheduler } from '../testing/marbles'; - -describe('ApiInterceptor', () => { - const API_BASE_URL = 'http://test.com'; - const API_PATH = '/foo/bar'; - const API_URL = `${API_BASE_URL}${API_PATH}`; - const OTHER_URL = 'http://example.com/foo/bar'; - const RESPONSE = 'OK'; - - const VALUES = { - n: null as null, - r: RESPONSE, - }; - - let scheduler: MarbleTestScheduler<any>; - let next: jasmine.SpyObj<HttpHandler>; - let conf: Configuration; - - beforeEach(() => { - scheduler = new MarbleTestScheduler(new MarbleFormatter(VALUES)); - - next = jasmine.createSpyObj('HttpHandler', ['handle']); - - conf = new Configuration(); - conf.apiBaseURL = API_BASE_URL; - - TestBed.configureTestingModule({ - providers: [ApiInterceptor, { provide: Configuration, useValue: conf }], - }); - }); - - it('should be created', inject( - [ApiInterceptor], - (service: ApiInterceptor) => { - expect(service).toBeTruthy(); - } - )); - - function testUrl(input: string, expected: string): void { - const NEXT_M = /***/ '--r'; - const INTER_M = /**/ '--r'; - - const req = new HttpRequest('GET', input); - - scheduler.run(({ expectObservable, cold }) => { - next.handle.and.callFake((r: HttpRequest<any>) => { - expect(r.url).toEqual(expected); - return cold(NEXT_M); - }); - - inject([ApiInterceptor], (service: ApiInterceptor) => - expectObservable(service.intercept(req, next)).toBe(INTER_M) - )(); - }); - } - - it('should prepend the base URL to hostless URLs', () => testUrl(API_PATH, API_URL)); - - it('should not prepend the base URL to full API URLs', () => testUrl(API_URL, API_URL)); - - it('should not change other URLs', () => testUrl(OTHER_URL, OTHER_URL)); - - it('should classify errors', () => { - const NEXT_M = /***/ '--#'; - const INTER_M = /**/ '--(e|)'; - - const ERR_IN = new Error('Error'); - (VALUES as any).e = new AppError(ERR_IN, ERR_IN.message, ERR_IN.stack, false); - - const req = new HttpRequest('GET', '/some/url'); - - scheduler - .withValues(VALUES) - .withError(ERR_IN) - .run(({ expectObservable, cold }) => { - next.handle.and.callFake(() => cold(NEXT_M)); - - inject([ApiInterceptor], (service: ApiInterceptor) => - expectObservable(service.intercept(req, next).pipe(catchError(e => of(e)))).toBe(INTER_M) - )(); - }); - }); -}); diff --git a/src/lib/api/api.interceptor.ts b/src/lib/api/api.interceptor.ts deleted file mode 100644 index b68123e3d76093e5422753ccd30838381c688134..0000000000000000000000000000000000000000 --- a/src/lib/api/api.interceptor.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { - HttpEvent, - HttpHandler, - HttpInterceptor, - HttpRequest, -} from '@angular/common/http'; -import { Injectable } from '@angular/core'; -import { normalizeError } from '@devatscience/ngx-errors'; -import { Observable, throwError } from 'rxjs'; -import { catchError } from 'rxjs/operators'; - -import { Configuration } from '../configuration'; - -/** - * Préfixe l'URL par BASE_URL si elle commence par "/" (c-à -d que c'est un chemin absolu), - * et ajoute l'authentification si nécessaire. - */ -@Injectable() -export class ApiInterceptor implements HttpInterceptor { - private readonly NON_API_PREFIX = /^(https?:)?\/\//i; - - public constructor(private readonly conf: Configuration) {} - - public intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { - if (!req.url.match(this.NON_API_PREFIX)) { - req = req.clone({ url: this.conf.apiBaseURL + req.url }); - } - - return next.handle(req).pipe(catchError((err: any) => throwError(normalizeError(err)))); - } -} diff --git a/src/lib/configuration.ts b/src/lib/configuration.ts index 7d218e3c44f93f481c98c4c55dbd02c607eefb24..fa497344abe8bb2f48bd02e50e211543f9845b64 100644 --- a/src/lib/configuration.ts +++ b/src/lib/configuration.ts @@ -44,3 +44,11 @@ export class Configuration implements IConfiguration { } } } + +export function configurationFactory(): Configuration { + return new Configuration({ + apiBaseURL: 'http://baliste-api.dvp', + debug: true, + debugToolbarURL: 'http://baliste-api.dvp/_wdt', + }); +} diff --git a/src/lib/debug-state.service.ts b/src/lib/debug-state.service.ts index ae75c05c326dfc4041bee349b3f3be87086bf034..a0b9b4453bcb0813c983e980b5c9af2a9a65ec2a 100644 --- a/src/lib/debug-state.service.ts +++ b/src/lib/debug-state.service.ts @@ -2,8 +2,8 @@ import { Injectable } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; import { distinctUntilChanged, map } from 'rxjs/operators'; -// TODO change this -const environment = { +// TODO injecter +export const environment = { production: false, apiURL: 'http://baliste-api.dvp', api: 'http://127.0.0.101:8040', diff --git a/src/lib/debug-toggle.component.ts b/src/lib/debug-toggle.component.ts index bebc94c45853ef24a712415f5bfc19600c07d96b..6e6c7040b8745a0f15eb27cbfe89e4b487a485ca 100644 --- a/src/lib/debug-toggle.component.ts +++ b/src/lib/debug-toggle.component.ts @@ -3,7 +3,7 @@ import { Component } from '@angular/core'; import { DebugStateService } from './debug-state.service'; @Component({ - selector: 'lib-debug-toggle', + selector: 'app-debug-toggle', template: ` <ng-container *ngIf="state.available"> <p-toggleButton diff --git a/src/lib/debug.module.ts b/src/lib/debug.module.ts index 2930d4513f1878bc4be836f3a7d93179ce2ce082..e98dc576af575898337b52662e53040c97794ce1 100644 --- a/src/lib/debug.module.ts +++ b/src/lib/debug.module.ts @@ -1,5 +1,4 @@ import { CommonModule } from '@angular/common'; -import { HTTP_INTERCEPTORS } from '@angular/common/http'; import { LOCALE_ID, NgModule } from '@angular/core'; import { ReactiveFormsModule } from '@angular/forms'; import { @@ -16,8 +15,7 @@ import { TreeModule } from 'primeng/tree'; import { TreeTableModule } from 'primeng/treetable'; import { ApiDebugComponent } from './api/api-debug.component'; -import { ApiDebugInterceptor } from './api/api-debug.interceptor'; -import { Configuration } from './configuration'; +import { Configuration, configurationFactory } from './configuration'; import { DumpPanelComponent } from './dump-panel.component'; import { DumpValueComponent } from './dump-value.component'; import { SpyDisplayComponent } from './spy/spy-display.component'; @@ -25,27 +23,16 @@ import { WatchDisplayComponent } from './watch/watch-display.component'; import { WatchComponent } from './watch/watch.component'; import { WatchService } from './watch/watch.service'; -export function configurationFactory(): Configuration { - return new Configuration({ - apiBaseURL: 'http://baliste-api.dvp', - debug: true, - debugToolbarURL: 'http://baliste-api.dvp/_wdt', - }); -} - const EXPORTED_COMPONENTS = [ - // + ApiDebugComponent, WatchComponent, DumpPanelComponent, - ApiDebugComponent, ]; @NgModule({ imports: [ - // CommonModule, ReactiveFormsModule, - SidebarModule, ButtonModule, TreeModule, @@ -58,17 +45,10 @@ const EXPORTED_COMPONENTS = [ TooltipModule, ], providers: [ - ApiDebugInterceptor, WatchService, - { - provide: HTTP_INTERCEPTORS, - useExisting: ApiDebugInterceptor, - multi: true, - }, { provide: Configuration, useFactory: configurationFactory }, { provide: LOCALE_ID, useValue: 'fr' }, ], - declarations: [ // DumpValueComponent, diff --git a/src/lib/dump-panel.component.html b/src/lib/dump-panel.component.html index 50484c3a88e252c2055fd8146c787265f0aa32fc..579f5034002d173f66225a7bb7820e658e57ec8e 100644 --- a/src/lib/dump-panel.component.html +++ b/src/lib/dump-panel.component.html @@ -18,17 +18,17 @@ <p-tabView> <p-tabPanel header="Watches ({{ watchCount }})"> <div class="data-panel"> - <lib-watch-display (countChanged)="setWatchCount($event)"></lib-watch-display> + <app-watch-display (countChanged)="setWatchCount($event)"></app-watch-display> </div> </p-tabPanel> <p-tabPanel header="Spies ({{ spyCount }})"> <div class="data-panel"> - <lib-spy-display (countChanged)="setSpyCount($event)"></lib-spy-display> + <app-spy-display (countChanged)="setSpyCount($event)"></app-spy-display> </div> </p-tabPanel> <p-tabPanel header="API ({{ apiCallCount }})"> <div class="data-panel"> - <lib-api-debug></lib-api-debug> + <app-api-debug (countChanged)="setApiCallCount($event)"></app-api-debug> </div> </p-tabPanel> </p-tabView> diff --git a/src/lib/dump-panel.component.ts b/src/lib/dump-panel.component.ts index 5abe71d1369d1c194b78dabcb6b54edf7e774574..2135f4866b9dfc2f3c429c56a6c991fde38bb429 100644 --- a/src/lib/dump-panel.component.ts +++ b/src/lib/dump-panel.component.ts @@ -1,9 +1,13 @@ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component } from '@angular/core'; +import { + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, +} from '@angular/core'; import { DebugStateService } from './debug-state.service'; @Component({ - selector: 'lib-dump-panel', + selector: 'app-dump-panel', templateUrl: './dump-panel.component.html', styleUrls: ['./dump-panel.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, @@ -27,4 +31,9 @@ export class DumpPanelComponent { this.spyCount = count; this.cd.markForCheck(); } + + public setApiCallCount(count: number): void { + this.apiCallCount = count; + this.cd.markForCheck(); + } } diff --git a/src/lib/dump-value.component.ts b/src/lib/dump-value.component.ts index 2fdc240b195de525c29f1caa62619b8876ab7237..566507dfa6356f807cf7e26edd9739995d3d3bb7 100644 --- a/src/lib/dump-value.component.ts +++ b/src/lib/dump-value.component.ts @@ -4,7 +4,7 @@ import { TreeNode } from 'primeng/api'; type PropertyPath = Array<string | number>; @Component({ - selector: 'lib-dump-value', + selector: 'app-dump-value', templateUrl: './dump-value.component.html', styleUrls: ['./dump-value.component.scss'], }) diff --git a/src/lib/index.ts b/src/lib/index.ts index 1548929e5d7870ddbe9c343c1a3163d8d9d805de..cf6c636c56fc1892768e539a9d476587f626a793 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -1,9 +1,18 @@ -export * from './rxjs/index'; // TODO make a package ? +export * from './api/api-debug.component'; +export * from './api/api-debug.interceptor'; export * from './debug.module'; +export * from './debug-state.service'; +export * from './debug-toggle.component'; export * from './dump-panel.component'; export * from './dump-value.component'; +export * from './rxjs/index'; export * from './spy/spy-display.component'; export * from './watch/watch.component'; export * from './watch/watch-display.component'; export * from './watch/watch.service'; export * from './configuration'; +export * from './debug.module'; +export * from './debug-state.service'; +export * from './debug-toggle.component'; +export * from './dump-panel.component'; +export * from './dump-value.component'; diff --git a/src/lib/rxjs/hooks.ts b/src/lib/rxjs/hooks.ts index 7950a5d6cc807cc4e7ac3d4f0aed43c2cf73a981..71edcc96f10682f55b111b6fd9d22c2c14f4ef02 100644 --- a/src/lib/rxjs/hooks.ts +++ b/src/lib/rxjs/hooks.ts @@ -31,6 +31,9 @@ function installHook<T extends Hookable<K, M>, M extends (this: T, ...args: any[ /** * Modifie une méthode d'un objet pour éxecuter une fonction avant son éxecution normale. * + * @param {object} target Le prototype à modifier. + * @param {string|symbol} name Le nom de la méthode à surcharger. + * @param {function} hook La fonction à ajouter. */ export function hookBefore< T extends Hookable<K, M>, @@ -51,6 +54,9 @@ export function hookBefore< /** * Modifie une méthode d'un objet pour éxecuter une fonction après son éxecution normale. * + * @param {object} target Le prototype à modifier. + * @param {string|symbol} name Le nom de la méthode à surcharger. + * @param {function} hook La fonction à ajouter. */ export function hookAfter< T extends Hookable<K, M>, @@ -71,6 +77,9 @@ export function hookAfter< /** * Modifie une méthode d'un objet pour éxecuter inconditionnellement une fonction après son éxecution normale. * + * @param {object} target Le prototype à modifier. + * @param {string|symbol} name Le nom de la méthode à surcharger. + * @param {function} hook La fonction à ajouter. */ export function hookFinally< T extends Hookable<K, M>, diff --git a/src/lib/rxjs/route-param.decorator.ts b/src/lib/rxjs/route-param.decorator.ts index 26827c317de5beeefdeb05b35af79954b17619ac..d1c7b1a2a0fc07fbbb1a7b565f525c33c7344663 100644 --- a/src/lib/rxjs/route-param.decorator.ts +++ b/src/lib/rxjs/route-param.decorator.ts @@ -47,8 +47,8 @@ function ParamFromMap<K extends 'paramMap' | 'queryParamMap'>( * * La propriété décorée doit implémenter Observer<string>. * - * param {string|null} param Nom du paramètre. Par défaut égal au nom de la propriété minus le '$' final. - * param {string} routeProperty nom de la propriété du Component contenant l'ActivatedRoute. Par défaut 'route'. + * @param {string|null} param Nom du paramètre. Par défaut égal au nom de la propriété minus le '$' final. + * @param {string} routeProperty nom de la propriété du Component contenant l'ActivatedRoute. Par défaut 'route'. */ export function RouteParam(param: string = null, routeProperty: string = 'route') { return ParamFromMap(param, routeProperty, 'paramMap'); @@ -59,8 +59,8 @@ export function RouteParam(param: string = null, routeProperty: string = 'route' * * La propriété décorée doit implémenter Observer<string>. * - * param {string|null} param Nom du paramètre. Par défaut égal au nom de la propriété minus le '$' final. - * param {string} routeProperty nom de la propriété du Component contenant l'ActivatedRoute. Par défaut 'route'. + * @param {string|null} param Nom du paramètre. Par défaut égal au nom de la propriété minus le '$' final. + * @param {string} routeProperty nom de la propriété du Component contenant l'ActivatedRoute. Par défaut 'route'. */ export function QueryParam(param: string = null, routeProperty: string = 'route') { return ParamFromMap(param, routeProperty, 'queryParamMap'); diff --git a/src/lib/rxjs/safe-combine-latest.observable.spec.ts b/src/lib/rxjs/safe-combine-latest.observable.spec.ts index 9406b854e04949880c6e5d117d3081bf64b984fe..77da580a8ba062b03cc399921dc11153bb4e0658 100644 --- a/src/lib/rxjs/safe-combine-latest.observable.spec.ts +++ b/src/lib/rxjs/safe-combine-latest.observable.spec.ts @@ -1,8 +1,7 @@ import { Observable } from 'rxjs'; -import { MarbleTestScheduler } from '../testing/marbles'; - import { safeCombineLatest } from './safe-combine-latest.observable'; +import { MarbleTestScheduler } from './testing/marbles'; describe('safe-combine-latest', () => { let scheduler: MarbleTestScheduler<any>; diff --git a/src/lib/rxjs/safe-fork-join.observable.spec.ts b/src/lib/rxjs/safe-fork-join.observable.spec.ts index c346b9576e35f15a6dadf233203b8fa786e5a625..d4dfadd5d2cdfaf128d9d193b63549a402c668fb 100644 --- a/src/lib/rxjs/safe-fork-join.observable.spec.ts +++ b/src/lib/rxjs/safe-fork-join.observable.spec.ts @@ -1,8 +1,7 @@ import { Observable } from 'rxjs'; -import { MarbleTestScheduler } from '../testing/marbles'; - import { safeForkJoin } from './safe-fork-join.observable'; +import { MarbleTestScheduler } from './testing/marbles'; describe('safe-fork-join', () => { let scheduler: MarbleTestScheduler<any>; diff --git a/src/lib/rxjs/subscribe-on-init.decorator.spec.ts b/src/lib/rxjs/subscribe-on-init.decorator.spec.ts index d22358663c3af274565ba06abd48f614ca2f6867..152c1ff43f25ebb150fd41fe0b171725d886b19a 100644 --- a/src/lib/rxjs/subscribe-on-init.decorator.spec.ts +++ b/src/lib/rxjs/subscribe-on-init.decorator.spec.ts @@ -1,9 +1,8 @@ import { OnDestroy, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; -import { MarbleTestScheduler } from '../testing/marbles'; - import { SubscribeOnInit } from './subscribe-on-init.decorator'; +import { MarbleTestScheduler } from './testing/marbles'; describe('@SubscribeOnInit', () => { const VALUES = { a: 'a' }; diff --git a/src/lib/testing/marbles.spec.ts b/src/lib/rxjs/testing/marbles.spec.ts similarity index 100% rename from src/lib/testing/marbles.spec.ts rename to src/lib/rxjs/testing/marbles.spec.ts diff --git a/src/lib/testing/marbles.ts b/src/lib/rxjs/testing/marbles.ts similarity index 98% rename from src/lib/testing/marbles.ts rename to src/lib/rxjs/testing/marbles.ts index 14b39d33982e5bcab3daa142b648e685cd9adf6f..bad7cfd7242ce57fa8537411026aea3d759559f8 100644 --- a/src/lib/testing/marbles.ts +++ b/src/lib/rxjs/testing/marbles.ts @@ -1,5 +1,5 @@ // tslint:disable-next-line:no-reference -///<reference path="../../../node_modules/@types/jasmine/index.d.ts"/> +///<reference path="node_modules/@types/jasmine/index.d.ts"/> /* tslint:disable:rxjs-no-internal */ import * as _ from 'lodash'; diff --git a/src/lib/rxjs/until-destroyed.operator.ts b/src/lib/rxjs/until-destroyed.operator.ts index 33a2d51f20bb961a31b4481ff72bdf76267255e9..b69bec20a4699556972d188c7f95465edc216161 100644 --- a/src/lib/rxjs/until-destroyed.operator.ts +++ b/src/lib/rxjs/until-destroyed.operator.ts @@ -10,10 +10,10 @@ const OPERATOR = Symbol.for('untilDestroyedOperator'); * Opérateur qui interrompt l'observable quand la méthode "ngOnDestroy" de l'objet passé * en paramètre est appelée. * - * param {OnDestroy} target - * return {MonoTypeOperatorFunction<T>} + * @param {OnDestroy} target + * @return {MonoTypeOperatorFunction<T>} * - * example + * @example * class Foo extends OnInit, OnDestroy { * private readonly data$: Observable<string>; * diff --git a/src/lib/spy/spy-display.component.html b/src/lib/spy/spy-display.component.html index 66ef017ad83339efc8eaaf94512ad6de02fecf8b..9f3424b23786506200911655b667d19db412192b 100644 --- a/src/lib/spy/spy-display.component.html +++ b/src/lib/spy/spy-display.component.html @@ -30,7 +30,7 @@ <td class="type"><span class="fa fa-{{ eventTypes[notif.type] }}"></span></td> <td class="tag">{{ notif.tag }}</td> <td class="value" *ngIf="notif.type === 'next'"> - <lib-dump-value [value]="notif.payload"></lib-dump-value> + <app-dump-value [value]="notif.payload"></app-dump-value> </td> <td class="error" *ngIf="notif.type === 'error'">{{ notif.payload }}</td> </tr> diff --git a/src/lib/spy/spy-display.component.ts b/src/lib/spy/spy-display.component.ts index 8108a13e9e73d2a9eaa5c6dea00686271f0c660c..7f086fd211df8cb3d19f2c1cf5a0c5e05bb0f27e 100644 --- a/src/lib/spy/spy-display.component.ts +++ b/src/lib/spy/spy-display.component.ts @@ -6,7 +6,7 @@ import { debounceTime, map, scan, share, tap } from 'rxjs/operators'; import { Notification, notifications$, NotificationType } from '../rxjs'; @Component({ - selector: 'lib-spy-display', + selector: 'app-spy-display', templateUrl: './spy-display.component.html', styleUrls: ['./spy-display.component.scss'], }) diff --git a/src/lib/watch/watch-display.component.html b/src/lib/watch/watch-display.component.html index fcdf7fb80c9ff523c7dfcc07e8a9d0c523e2672e..9154fe2b86b140b6a43ee15df4e08ff992f6b2d0 100644 --- a/src/lib/watch/watch-display.component.html +++ b/src/lib/watch/watch-display.component.html @@ -1,5 +1,5 @@ <ng-container *ngFor="let value of (values$ | async); trackBy: label"> <p-panel header="{{ value.label }}" [toggleable]="true" ngClass="value"> - <lib-dump-value [value]="value.value"></lib-dump-value> + <app-dump-value [value]="value.value"></app-dump-value> </p-panel> </ng-container> diff --git a/src/lib/watch/watch-display.component.ts b/src/lib/watch/watch-display.component.ts index 75e84ccaf9441c9acc31f9ca376c3f3709444e32..f7c132b519830f2ecc4024d07c3330b350fa90ed 100644 --- a/src/lib/watch/watch-display.component.ts +++ b/src/lib/watch/watch-display.component.ts @@ -4,7 +4,7 @@ import { tap } from 'rxjs/operators'; import { WatchedValue, WatchService } from './watch.service'; @Component({ - selector: 'lib-watch-display', + selector: 'app-watch-display', templateUrl: './watch-display.component.html', }) export class WatchDisplayComponent { diff --git a/src/lib/watch/watch.component.ts b/src/lib/watch/watch.component.ts index 994d5473112c12fcd5a89ce2729b55a2c4dff120..93b7861ccd624a5f3730e5bc27e74eedfdf62c7f 100644 --- a/src/lib/watch/watch.component.ts +++ b/src/lib/watch/watch.component.ts @@ -5,7 +5,7 @@ import { distinctUntilChanged, map } from 'rxjs/operators'; import { WatchedValue, WatchService } from './watch.service'; @Component({ - selector: 'lib-watch', + selector: 'app-watch', template: '', }) export class WatchComponent implements OnInit, OnDestroy { diff --git a/src/public-api.ts b/src/public-api.ts new file mode 100644 index 0000000000000000000000000000000000000000..4d3287609a64a50d08594992445d6be0af7136af --- /dev/null +++ b/src/public-api.ts @@ -0,0 +1,22 @@ +/* + * Public API Surface of ngx-debug + */ + +export * from './lib/api/api-debug.component'; +export * from './lib/api/api-debug.interceptor'; +export * from './lib/debug.module'; +export * from './lib/debug-state.service'; +export * from './lib/debug-toggle.component'; +export * from './lib/dump-panel.component'; +export * from './lib/dump-value.component'; +export * from './lib/rxjs/index'; +export * from './lib/spy/spy-display.component'; +export * from './lib/watch/watch.component'; +export * from './lib/watch/watch-display.component'; +export * from './lib/watch/watch.service'; +export * from './lib/configuration'; +export * from './lib/debug.module'; +export * from './lib/debug-state.service'; +export * from './lib/debug-toggle.component'; +export * from './lib/dump-panel.component'; +export * from './lib/dump-value.component'; diff --git a/src/src.ts b/src/src.ts deleted file mode 100644 index 8dc3c937d1e5a2e80fb04c04c663acf271a976d6..0000000000000000000000000000000000000000 --- a/src/src.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Public API Surface of debugger - */ - -export * from './lib/debug.module'; -export * from './lib/dump-panel.component'; -export * from './lib/dump-value.component'; -export * from './lib/spy/spy-display.component'; -export * from './lib/watch/watch.component'; -export * from './lib/watch/watch-display.component'; -export * from './lib/watch/watch.service'; -export * from './lib/configuration';