From a283882b3b90452fa8a99679b227141756d5ad84 Mon Sep 17 00:00:00 2001 From: deku-nattsu Date: Tue, 11 Nov 2025 19:51:05 +0100 Subject: [PATCH 1/2] refactor(@angular/build): update private exports to allow external cache usage --- packages/angular/build/src/private.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/angular/build/src/private.ts b/packages/angular/build/src/private.ts index 5368eb3574e5..1c67c5d5226c 100644 --- a/packages/angular/build/src/private.ts +++ b/packages/angular/build/src/private.ts @@ -35,6 +35,8 @@ export { transformSupportedBrowsersToTargets } from './tools/esbuild/utils'; export { SassWorkerImplementation } from './tools/sass/sass-service'; export { SourceFileCache } from './tools/esbuild/angular/source-file-cache'; +export { Cache } from './tools/esbuild/cache'; +export { LmbdCacheStore } from './tools/esbuild/lmdb-cache-store'; export { createJitResourceTransformer } from './tools/angular/transformers/jit-resource-transformer'; export { JavaScriptTransformer } from './tools/esbuild/javascript-transformer'; From 60b39e485cf58d238d00d14ba781ba31ba2660e3 Mon Sep 17 00:00:00 2001 From: deku-nattsu Date: Tue, 11 Nov 2025 20:03:20 +0100 Subject: [PATCH 2/2] refactor(@angular/build): fix LmdbCacheStore typo --- packages/angular/build/src/private.ts | 2 +- .../build/src/tools/esbuild/angular/compiler-plugin.ts | 6 +++--- packages/angular/build/src/tools/esbuild/i18n-inliner.ts | 8 ++++---- .../angular/build/src/tools/esbuild/lmdb-cache-store.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/angular/build/src/private.ts b/packages/angular/build/src/private.ts index 1c67c5d5226c..8012ad7f567a 100644 --- a/packages/angular/build/src/private.ts +++ b/packages/angular/build/src/private.ts @@ -36,7 +36,7 @@ export { SassWorkerImplementation } from './tools/sass/sass-service'; export { SourceFileCache } from './tools/esbuild/angular/source-file-cache'; export { Cache } from './tools/esbuild/cache'; -export { LmbdCacheStore } from './tools/esbuild/lmdb-cache-store'; +export { LmdbCacheStore } from './tools/esbuild/lmdb-cache-store'; export { createJitResourceTransformer } from './tools/angular/transformers/jit-resource-transformer'; export { JavaScriptTransformer } from './tools/esbuild/javascript-transformer'; diff --git a/packages/angular/build/src/tools/esbuild/angular/compiler-plugin.ts b/packages/angular/build/src/tools/esbuild/angular/compiler-plugin.ts index eb9daa3b6155..95e6694b728b 100644 --- a/packages/angular/build/src/tools/esbuild/angular/compiler-plugin.ts +++ b/packages/angular/build/src/tools/esbuild/angular/compiler-plugin.ts @@ -73,11 +73,11 @@ export function createCompilerPlugin( // Initialize a worker pool for JavaScript transformations. // Webcontainers currently do not support this persistent cache store. - let cacheStore: import('../lmdb-cache-store').LmbdCacheStore | undefined; + let cacheStore: import('../lmdb-cache-store').LmdbCacheStore | undefined; if (pluginOptions.sourceFileCache?.persistentCachePath && !process.versions.webcontainer) { try { - const { LmbdCacheStore } = await import('../lmdb-cache-store'); - cacheStore = new LmbdCacheStore( + const { LmdbCacheStore } = await import('../lmdb-cache-store'); + cacheStore = new LmdbCacheStore( path.join(pluginOptions.sourceFileCache.persistentCachePath, 'angular-compiler.db'), ); } catch (e) { diff --git a/packages/angular/build/src/tools/esbuild/i18n-inliner.ts b/packages/angular/build/src/tools/esbuild/i18n-inliner.ts index 365fbb300953..fcb439b84c5c 100644 --- a/packages/angular/build/src/tools/esbuild/i18n-inliner.ts +++ b/packages/angular/build/src/tools/esbuild/i18n-inliner.ts @@ -11,7 +11,7 @@ import { createHash } from 'node:crypto'; import { extname, join } from 'node:path'; import { WorkerPool } from '../../utils/worker-pool'; import { BuildOutputFile, BuildOutputFileType } from './bundler-context'; -import type { LmbdCacheStore } from './lmdb-cache-store'; +import type { LmdbCacheStore } from './lmdb-cache-store'; import { createOutputFile } from './utils'; /** @@ -39,7 +39,7 @@ export interface I18nInlinerOptions { export class I18nInliner { #cacheInitFailed = false; #workerPool: WorkerPool; - #cache: LmbdCacheStore | undefined; + #cache: LmdbCacheStore | undefined; readonly #localizeFiles: ReadonlyMap; readonly #unmodifiedFiles: Array; @@ -274,9 +274,9 @@ export class I18nInliner { // Initialize a persistent cache for i18n transformations. try { - const { LmbdCacheStore } = await import('./lmdb-cache-store'); + const { LmdbCacheStore } = await import('./lmdb-cache-store'); - this.#cache = new LmbdCacheStore(join(persistentCachePath, 'angular-i18n.db')); + this.#cache = new LmdbCacheStore(join(persistentCachePath, 'angular-i18n.db')); } catch { this.#cacheInitFailed = true; diff --git a/packages/angular/build/src/tools/esbuild/lmdb-cache-store.ts b/packages/angular/build/src/tools/esbuild/lmdb-cache-store.ts index 7d03cb597738..dba108285342 100644 --- a/packages/angular/build/src/tools/esbuild/lmdb-cache-store.ts +++ b/packages/angular/build/src/tools/esbuild/lmdb-cache-store.ts @@ -9,7 +9,7 @@ import { RootDatabase, open } from 'lmdb'; import { Cache, CacheStore } from './cache'; -export class LmbdCacheStore implements CacheStore { +export class LmdbCacheStore implements CacheStore { readonly #cacheFileUrl; #db: RootDatabase | undefined;