CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-angular-devkit--build-ng-packagr

Angular Build Architect builder for ng-packagr library packaging (deprecated)

89

1.00x
Overview
Eval results
Files

task.mdevals/scenario-5/

Library Build Cache Manager

Build a tool that configures and manages build caching for Angular library projects using the Angular Architect build system.

Capabilities

Cache Environment Detection

Determines whether caching should be enabled based on workspace configuration and execution environment.

  • Given cacheMetadata with enabled=true and environment='all', isCacheEnabled returns true regardless of isCI or isWebContainer values (when isWebContainer is false) @test
  • Given cacheMetadata with environment='local' and isCI=false, isCacheEnabled returns true @test
  • Given cacheMetadata with environment='local' and isCI=true, isCacheEnabled returns false @test
  • Given cacheMetadata with environment='ci' and isCI=true, isCacheEnabled returns true @test
  • Given cacheMetadata with environment='ci' and isCI=false, isCacheEnabled returns false @test
  • Given isWebContainer=true, isCacheEnabled returns false regardless of other parameters @test

Cache Directory Management

Generates version-isolated cache directory paths and purges stale caches from previous versions.

  • Given baseDirectory="/cache", angularVersion="19.0.0", and packageName="ng-packagr", getCacheDirectory returns "/cache/v19/ng-packagr" @test
  • Given a base directory with caches for versions v17, v18, and v19, and currentVersion="19", purgeStaleCache removes v17 and v18 directories but preserves v19 @test

Implementation

@generates

API

/**
 * Determines if caching should be enabled based on workspace metadata and environment
 *
 * @param {Object} cacheMetadata - Workspace cache configuration
 * @param {boolean} [cacheMetadata.enabled] - Whether caching is explicitly enabled/disabled
 * @param {string} [cacheMetadata.environment] - Cache environment: 'local', 'ci', or 'all'
 * @param {boolean} isCI - Whether currently running in CI environment
 * @param {boolean} isWebContainer - Whether running in WebContainer environment
 * @returns {boolean} True if caching should be enabled
 */
function isCacheEnabled(cacheMetadata, isCI, isWebContainer) {
  // IMPLEMENTATION HERE
}

/**
 * Generates cache directory path with version isolation
 *
 * @param {string} baseDirectory - Base cache directory path
 * @param {string} angularVersion - Angular CLI version (e.g., "19.0.0")
 * @param {string} packageName - Package name (e.g., "ng-packagr")
 * @returns {string} Full cache directory path
 */
function getCacheDirectory(baseDirectory, angularVersion, packageName) {
  // IMPLEMENTATION HERE
}

/**
 * Purges stale caches from previous Angular versions
 *
 * @param {string} baseDirectory - Base cache directory path
 * @param {string} currentVersion - Current Angular CLI version to preserve
 * @returns {Promise<void>}
 */
async function purgeStaleCache(baseDirectory, currentVersion) {
  // IMPLEMENTATION HERE
}

module.exports = {
  isCacheEnabled,
  getCacheDirectory,
  purgeStaleCache
};

Dependencies { .dependencies }

@angular-devkit/build-ng-packagr { .dependency }

Provides Angular Architect builder for ng-packagr with build caching capabilities.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-angular-devkit--build-ng-packagr

tile.json