/** * Role Resolver * * Determines the `role` field written per project into * architecture/dependencies.json — a project's ROLE, orthogonal to its * `framework` (libType). Known values: * * - `server` — a runnable server app; DI design roots on `@DocumentDesign`. * - `app` — a runnable non-HTTP application bootstrapped via * `container.get(XxxApp)` (e.g. the tooling packages); DI design * roots on `@DocumentDesign`, drawn exactly like a server. * - `bundle` — an aggregator that BUNDLES several apps into one distributable * (e.g. an nx plugin re-exposing multiple tooling apps). It is the * one role permitted to depend on `role:app` projects; it has no DI * design of its own (it is a container of apps, not a designed root). * - `designed-lib` — a library whose DI design we generate; roots on * `@DocumentDesign` (required to have ≥1). * - `lib` — a plain library; no DI design is generated. * - `client` — a client app (e.g. angular-site); angular apps keep their * component/route design, others get none. * - `api-lib` — an API-contract library: exports `@ApiPath`/`@Rpc`/`@PubSub` * abstract `*Api` classes that servers implement and clients * generate typed clients from. No DI design of its own. * * Resolution order: * 1. Explicit nx tag `role:` on the project (project.json tags) — the * source of truth; every project should carry one (enforced by the * `role-tag` code rule). * 2. Fallback: 'lib' (a plain library with no generated design) — the safe * default so an untagged project never claims to be a server/client. */ import { ProjectInfo } from './project-info'; export declare const ROLE_TAG_PREFIX = "role:"; /** The roles the `role-tag` rule and the DI-graph analyzer understand. */ export declare const KNOWN_ROLES: ReadonlyArray; /** Default role for a project with no explicit `role:` tag. */ export declare const DEFAULT_ROLE = "lib"; export declare class RoleResolution { /** Resolved role name, or null when resolution failed */ readonly role: string | null; /** Problem description when resolution failed, otherwise null */ readonly problem: string | null; constructor( /** Resolved role name, or null when resolution failed */ role: string | null, /** Problem description when resolution failed, otherwise null */ problem: string | null); } export declare function resolveRole(info: ProjectInfo): RoleResolution;