/** * Validate Nx Wiring Executor * * Enforces that the build graph is wired for correct build ORDER. Two checks: * * 1. nx.json targetDefaults — the compile executors (@nx/js:tsc, @angular/build:application) * must carry the load-bearing dependsOn: * ["^build"] * * 2. Per-project override guard — a project that declares its OWN build.dependsOn OVERRIDES * the targetDefaults entirely (nx does not merge dependsOn). That silently drops `^build` * (→ upstream libs not built first, builds against an empty dist). So we check each compile * project's RESOLVED build.dependsOn and fail if `^build` is missing. * * NOTE: the webpieces validators (architecture:validate-complete, per-project file-import * cycles, DI-graph unchanged) NO LONGER ride on the compile target. They live on the `ci` * composite target (synthesized by this plugin's createCiTarget), so `build`/compile is a * fast compile-only step while `nx ci` runs the full gate. This executor therefore only * guards build ORDER (`^build`), not the validators — those are guaranteed by the plugin. * * Conservative by design: only REQUIRES wiring on compile executors actually in use * (@nx/js:tsc, @angular/build:application). A repo that uses neither passes. * * Disable via webpieces.config.json rules["nx-wiring"].mode="OFF". * * Usage: nx run architecture:validate-nx-wiring */ import type { ExecutorContext } from '@nx/devkit'; export interface ValidateNxWiringOptions { requiredDeps?: string[]; compileExecutors?: string[]; } export interface ExecutorResult { success: boolean; } export default function runExecutor(options: ValidateNxWiringOptions, context: ExecutorContext): Promise;