Angular Build Architect builder for ng-packagr library packaging (deprecated)
89
Build a library build orchestration system that manages the compilation and packaging of Angular libraries using the @angular-devkit/build-ng-packagr builder.
Create a build orchestrator that:
Your implementation should handle the complete build lifecycle from configuration to execution.
Execute library builds with proper configuration and mode support.
Manage build caching with environment-aware strategies.
Support flexible build configuration options.
@generates
import { BuilderContext, BuilderOutput } from '@angular-devkit/architect';
import { Observable } from 'rxjs';
/**
* Options for configuring the library build
*/
export interface BuildOptions {
/** Path to ng-package.json configuration file */
project: string;
/** Optional path to TypeScript configuration file */
tsConfig?: string;
/** Enable watch mode for continuous rebuilds */
watch?: boolean;
/** Polling interval in milliseconds for file watching */
poll?: number;
}
/**
* Cache configuration for the build process
*/
export interface CacheConfig {
/** Whether caching is enabled */
enabled: boolean;
/** Cache environment strategy: 'local', 'ci', or 'all' */
environment: 'local' | 'ci' | 'all';
/** Path to the cache directory */
directory: string;
}
/**
* Executes the library build process with the given options
*
* @param options - Build configuration options
* @param context - Builder context with workspace information
* @returns Observable that emits build results
*/
export function executeBuild(
options: BuildOptions,
context: BuilderContext
): Observable<BuilderOutput>;
/**
* Configures caching strategy based on environment
*
* @param cacheMetadata - Cache configuration from project metadata
* @param isCI - Whether running in CI environment
* @returns Resolved cache configuration
*/
export function configureCaching(
cacheMetadata: { enabled?: boolean; environment?: 'local' | 'ci' | 'all'; path?: string },
isCI: boolean
): CacheConfig;
/**
* Purges stale build caches from previous versions
*
* @param cacheDirectory - Root cache directory path
* @param currentVersion - Current Angular version
* @returns Promise that resolves when cleanup is complete
*/
export function purgeStaleCache(
cacheDirectory: string,
currentVersion: string
): Promise<void>;Provides the ng-packagr builder for compiling and packaging Angular libraries
@satisfied-by
Provides builder context and output types for Angular Architect system
@satisfied-by
Provides Observable support for reactive build process management
@satisfied-by
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