Angular Build Architect builder for ng-packagr library packaging (deprecated)
89
Build a configuration manager for an Angular library build system that validates and processes builder options according to a JSON schema.
Your task is to create a configuration validation and processing system that:
Accepts configuration options with the following properties:
project (required): Path to the ng-package.json configuration filetsConfig (optional): Path to a TypeScript configuration file overridewatch (optional): Boolean flag to enable watch mode (defaults to false)poll (optional): Number representing the file watching poll interval in millisecondsValidates configuration against a schema that enforces:
project field must be a non-empty stringtsConfig field, if provided, must be a stringwatch field, if provided, must be a booleanpoll field, if provided, must be a positive numberResolves paths relative to a workspace root directory:
project and tsConfig) to absolute pathsReturns validated configuration as a structured object containing:
valid boolean indicating if validation succeedederrors array containing any validation error messages@generates
Create your implementation in TypeScript following the API specification below.
/**
* Configuration options for the builder
*/
export interface BuilderOptions {
project: string;
tsConfig?: string;
watch?: boolean;
poll?: number;
}
/**
* Validated configuration with resolved paths
*/
export interface ValidatedConfig {
valid: boolean;
errors: string[];
resolvedOptions?: {
project: string;
tsConfig?: string;
watch: boolean;
poll?: number;
};
}
/**
* Validates and processes builder configuration options
*
* @param options - The builder options to validate
* @param workspaceRoot - The workspace root directory for path resolution
* @returns Validated configuration with resolved paths
*/
export function validateAndResolveConfig(
options: BuilderOptions,
workspaceRoot: string
): ValidatedConfig;Provides Angular library build functionality and configuration patterns.
Install with Tessl CLI
npx tessl i tessl/npm-angular-devkit--build-ng-packagrdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10