/** * Unified Nx Inference Plugin for @webpieces/nx-webpieces-rules * * This plugin automatically creates targets for: * 1. Workspace-level architecture validation (generate, visualize, validate-*) * 2. Per-project circular dependency checking * * Install with: nx add @webpieces/nx-webpieces-rules * * Usage: * Add to nx.json plugins array: * { * "plugins": ["@webpieces/nx-webpieces-rules"] * } * * Then all targets appear automatically without manual project.json configuration. */ import type { CreateNodesV2, TargetConfiguration } from '@nx/devkit'; /** * Circular dependency checking options */ export interface CircularDepsOptions { enabled?: boolean; targetName?: string; excludePatterns?: string[]; } /** * Validation options for architecture checks */ export interface ValidationOptions { noCycles?: boolean; architectureUnchanged?: boolean; validatePackageJson?: boolean; validateNewMethods?: boolean; validateModifiedMethods?: boolean; validateModifiedFiles?: boolean; validateVersionsLocked?: boolean; validateTsInSrc?: boolean; validateNxWiring?: boolean; runtimeArchitecture?: boolean; validateApiRelations?: boolean; validateApiLibTag?: boolean; diGraph?: boolean; newMethodsMaxLines?: number; modifiedAndNewMethodsMaxLines?: number; modifiedFilesMaxLines?: number; /** * Validation mode for method/file size limits: * - STRICT: All limits enforced, disable comments ignored * - NORMAL: Limits enforced, disable comments with dates work * - OFF: Skip size validations entirely (for fast iteration) */ validationMode?: 'STRICT' | 'NORMAL' | 'OFF'; } /** * Feature flags for workspace targets */ export interface FeatureOptions { generate?: boolean; visualize?: boolean; visualizeRuntime?: boolean; } /** * Workspace-level configuration options */ export interface WorkspaceOptions { enabled?: boolean; targetPrefix?: string; graphPath?: string; validations?: ValidationOptions; features?: FeatureOptions; } /** * Configuration for @webpieces/nx-webpieces-rules Nx plugin */ export interface ArchitecturePluginOptions { circularDeps?: CircularDepsOptions; workspace?: WorkspaceOptions; } export declare function isInsideNestedGitRepo(workspaceRoot: string, projectRoot: string): boolean; /** * Nx V2 Inference Plugin * Matches project.json and package.json files to create targets */ export declare const createNodesV2: CreateNodesV2; /** * Create per-project ci target - Gradle-style composite target * Composite CI target: runs lint, build, test, and every validation gate. * * Validation (architecture graph completeness, per-project file-import cycles, DI-graph * unchanged) lives HERE, not on the build/compile target. That keeps `nx build` a fast * compile-only step for local iteration while `nx ci` is the full gate the PR check runs. * * The per-project gates are passed in because they exist only on project.json projects; * `architecture:validate-complete` is a cross-project dep added only when the workspace * `architecture` project exists. * * NOTE: Type checking is done by the build target (@nx/js:tsc) during compilation. */ export declare function createCiTarget(perProjectValidation: string[], architectureEnabled: boolean): TargetConfiguration; /** * Export plugin as default for Nx */ declare const _default: { createNodesV2: CreateNodesV2; }; export default _default;