48 lines
1.6 KiB
TypeScript
48 lines
1.6 KiB
TypeScript
import { provideHttpClient, withFetch } from '@angular/common/http';
|
|
import {
|
|
ApplicationConfig,
|
|
provideBrowserGlobalErrorListeners,
|
|
} from '@angular/core';
|
|
import {
|
|
provideRouter,
|
|
withComponentInputBinding,
|
|
withRouterConfig,
|
|
} from '@angular/router';
|
|
import { provideIdentityInfrastructure } from '@task-stream/web/identity/infrastructure';
|
|
import {
|
|
apiConfigFromLocation,
|
|
provideApiConfig,
|
|
provideGraphql,
|
|
} from '@task-stream/web/shared/infrastructure';
|
|
import { providePiUi, ToastService } from '@task-stream/web/shared/ui';
|
|
import { Notifications } from '@task-stream/web/tracker/application';
|
|
import { provideTrackerInfrastructure } from '@task-stream/web/tracker/infrastructure';
|
|
import { appRoutes } from './app.routes';
|
|
|
|
/*
|
|
* Composition root of the web client:
|
|
* presenters (routes/pages) → application (NgRx signal stores, events) → domain ports ← infrastructure (GraphQL/HTTP)
|
|
*/
|
|
export const appConfig: ApplicationConfig = {
|
|
providers: [
|
|
provideBrowserGlobalErrorListeners(),
|
|
provideRouter(
|
|
appRoutes,
|
|
// Route params / query params straight into component inputs (`key`, `issueKey`, `returnUrl`…).
|
|
withComponentInputBinding(),
|
|
withRouterConfig({ paramsInheritanceStrategy: 'always' }),
|
|
),
|
|
provideHttpClient(withFetch()),
|
|
providePiUi(),
|
|
|
|
// API: same origin, proxied in development (proxy.conf.json) and by nginx in Docker.
|
|
provideApiConfig(apiConfigFromLocation()),
|
|
provideGraphql(),
|
|
|
|
// Ports → adapters
|
|
provideIdentityInfrastructure(),
|
|
provideTrackerInfrastructure(),
|
|
{ provide: Notifications, useExisting: ToastService },
|
|
],
|
|
};
|