@analogjs/vite-plugin-angular 3.0.0-beta.57 → 3.0.0-beta.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/migrations/migrate-setup-vitest/migrate-setup-vitest.js +1 -2
- package/package.json +2 -2
- package/src/index.js +1 -2
- package/src/lib/analog-plugin-interop.js +1 -2
- package/src/lib/angular-build-context.js +3 -4
- package/src/lib/angular-build-optimizer-plugin.js +2 -3
- package/src/lib/angular-jit-plugin.js +3 -4
- package/src/lib/angular-vite-plugin.js +4 -5
- package/src/lib/angular-vitest-plugin.js +2 -3
- package/src/lib/companion-plugins.js +2 -3
- package/src/lib/compilation-api/compilation-api-plugin.js +6 -7
- package/src/lib/compilation-api/index.js +1 -2
- package/src/lib/compiler/angular-version.js +0 -1
- package/src/lib/compiler/class-field-lowering.js +1 -2
- package/src/lib/compiler/compile.js +2 -3
- package/src/lib/compiler/compile.js.map +1 -1
- package/src/lib/compiler/constants.js +1 -2
- package/src/lib/compiler/debug.js +1 -2
- package/src/lib/compiler/defer.js +1 -2
- package/src/lib/compiler/dts-reader.js +1 -2
- package/src/lib/compiler/dts-reader.js.map +1 -1
- package/src/lib/compiler/hmr.js +1 -2
- package/src/lib/compiler/index.js +3 -3
- package/src/lib/compiler/jit-metadata.js +1 -2
- package/src/lib/compiler/jit-transform.js +2 -3
- package/src/lib/compiler/js-emitter.js +1 -2
- package/src/lib/compiler/metadata.js +2 -3
- package/src/lib/compiler/registry.js +2 -3
- package/src/lib/compiler/resource-inliner.js +1 -2
- package/src/lib/compiler/resource-inliner.js.map +1 -1
- package/src/lib/compiler/style-ast.js +1 -2
- package/src/lib/compiler/type-elision.js +1 -2
- package/src/lib/compiler/utils.js +1 -2
- package/src/lib/compiler/utils.js.map +1 -1
- package/src/lib/compiler-plugin.js +1 -2
- package/src/lib/component-resolvers.js +1 -2
- package/src/lib/component-scanner.js +3 -4
- package/src/lib/component-scanner.js.map +1 -1
- package/src/lib/component-styles-plugin.js +3 -4
- package/src/lib/compose-angular-plugins.js +2 -3
- package/src/lib/dev-server-mode-plugin.js +1 -2
- package/src/lib/encapsulation-plugin.js +1 -2
- package/src/lib/fast-compile-api.js +1 -2
- package/src/lib/fast-compile-plugin.js +11 -12
- package/src/lib/fast-compile-plugin.js.map +1 -1
- package/src/lib/host.js +3 -4
- package/src/lib/hot-update-batch.js +1 -2
- package/src/lib/live-reload-plugin.js +2 -3
- package/src/lib/ngp-compile-api.js +1 -2
- package/src/lib/ngp-compile-plugin.js +7 -8
- package/src/lib/ngp-compile-plugin.js.map +1 -1
- package/src/lib/ngtsc-compile-plugin.js +10 -11
- package/src/lib/nx-folder-plugin.js +1 -2
- package/src/lib/plugins/file-replacements.plugin.js +2 -3
- package/src/lib/router-plugin.js +2 -3
- package/src/lib/style-preprocessor.js +1 -2
- package/src/lib/stylesheet-registry.js +1 -2
- package/src/lib/stylesheet-registry.js.map +1 -1
- package/src/lib/tools/src/builders/vite/vite-build.impl.js +1 -2
- package/src/lib/tools/src/builders/vite/vite-build.impl.js.map +1 -1
- package/src/lib/tools/src/builders/vite-dev-server/dev-server.impl.js +1 -2
- package/src/lib/tools/src/builders/vite-dev-server/dev-server.impl.js.map +1 -1
- package/src/lib/utils/compilation-shared.js +2 -3
- package/src/lib/utils/css-extension-resolver.js +1 -2
- package/src/lib/utils/css-preprocessor-workers.js +1 -2
- package/src/lib/utils/debug-harness.js +1 -2
- package/src/lib/utils/debug-log-file.js +1 -2
- package/src/lib/utils/debug.js +1 -2
- package/src/lib/utils/devkit.js +1 -2
- package/src/lib/utils/hmr-component-updates.js +1 -2
- package/src/lib/utils/jit-inline-styles.js +1 -2
- package/src/lib/utils/lsp-type-checker.js +1 -2
- package/src/lib/utils/ngp-host-fs.js +1 -2
- package/src/lib/utils/plugin-config.js +1 -2
- package/src/lib/utils/rolldown.js +1 -2
- package/src/lib/utils/safe-module-paths.js +1 -2
- package/src/lib/utils/stylesheet-warning.js +1 -2
- package/src/lib/utils/transform-cache.js +1 -2
- package/src/lib/utils/transform-cache.js.map +1 -1
- package/src/lib/utils/tsconfig-resolver.js +1 -2
- package/src/lib/utils/virtual-ids.js +1 -2
- package/src/lib/utils/virtual-resources.js +1 -2
- package/src/lib/utils/virtual-resources.js.map +1 -1
- package/src/lib/virtual-modules-plugin.js +28 -4
- package/src/lib/virtual-modules-plugin.js.map +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ensureAngularBuildContext, getFilenameFromPath } from "./angular-build-context.js";
|
|
2
2
|
import { getComponentStyleSheetMeta, isComponentStyleSheet } from "./encapsulation-plugin.js";
|
|
3
3
|
import { preprocessStylesheet, rewriteRelativeCssImports } from "./stylesheet-registry.js";
|
|
4
4
|
import { describeStylesheetContent } from "./utils/compilation-shared.js";
|
|
5
|
-
import {
|
|
5
|
+
import { debugHmr, debugHmrV, debugStylesV } from "./utils/debug.js";
|
|
6
6
|
import { union } from "es-toolkit";
|
|
7
7
|
import { existsSync, readFileSync } from "node:fs";
|
|
8
8
|
import { normalizePath } from "vite";
|
|
9
|
-
|
|
9
|
+
// packages/vite-plugin-angular/src/lib/component-styles-plugin.ts
|
|
10
10
|
/**
|
|
11
11
|
* Self-contained Vite plugin that resolves and serves externalized Angular
|
|
12
12
|
* component stylesheets (`?ngcomp=...`) from the shared `AngularBuildContext`
|
|
@@ -347,7 +347,6 @@ async function handleDirectComponentStyleHmr(options) {
|
|
|
347
347
|
});
|
|
348
348
|
return [];
|
|
349
349
|
}
|
|
350
|
-
//#endregion
|
|
351
350
|
export { componentStylesPlugin, diagnoseComponentStylesheetPipeline, findComponentStylesheetWrapperModules, findTemplateOwnerModules, getModulesForChangedFile, handleDirectComponentStyleHmr, isModuleForChangedResource, markModuleSelfAccepting };
|
|
352
351
|
|
|
353
352
|
//# sourceMappingURL=component-styles-plugin.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ensureAngularBuildContext } from "./angular-build-context.js";
|
|
2
|
-
import { composeWithCompanions } from "./companion-plugins.js";
|
|
3
2
|
import { compilationApiPlugin } from "./compilation-api/compilation-api-plugin.js";
|
|
3
|
+
import { composeWithCompanions } from "./companion-plugins.js";
|
|
4
4
|
import { fastCompilePlugin } from "./fast-compile-plugin.js";
|
|
5
5
|
import { ngpCompilePlugin } from "./ngp-compile-plugin.js";
|
|
6
6
|
import { ngtscCompilePlugin } from "./ngtsc-compile-plugin.js";
|
|
7
|
-
|
|
7
|
+
// packages/vite-plugin-angular/src/lib/compose-angular-plugins.ts
|
|
8
8
|
/**
|
|
9
9
|
* Instantiates the compiler plugin matching `ctx.options.compilation` and
|
|
10
10
|
* registers its `AngularCompilerCapabilities` onto `ctx`.
|
|
@@ -25,7 +25,6 @@ function composeAngularPlugins(ctxOrOptions) {
|
|
|
25
25
|
const ctx = ensureAngularBuildContext(ctxOrOptions);
|
|
26
26
|
return composeWithCompanions(ctx, selectAngularCompilerPlugin(ctx));
|
|
27
27
|
}
|
|
28
|
-
//#endregion
|
|
29
28
|
export { composeAngularPlugins, selectAngularCompilerPlugin };
|
|
30
29
|
|
|
31
30
|
//# sourceMappingURL=compose-angular-plugins.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isServerEnvironment } from "./utils/plugin-config.js";
|
|
2
|
-
|
|
2
|
+
// packages/vite-plugin-angular/src/lib/dev-server-mode-plugin.ts
|
|
3
3
|
/**
|
|
4
4
|
* Defines `ngServerMode: 'true'` for server environments during `vite serve`.
|
|
5
5
|
* Runs after other plugins' `configEnvironment` hooks so an explicit
|
|
@@ -17,7 +17,6 @@ function devServerModePlugin() {
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { devServerModePlugin };
|
|
22
21
|
|
|
23
22
|
//# sourceMappingURL=dev-server-mode-plugin.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { debugStylesV } from "./utils/debug.js";
|
|
2
2
|
import { encapsulateStyle } from "@angular/compiler";
|
|
3
|
-
|
|
3
|
+
// packages/vite-plugin-angular/src/lib/encapsulation-plugin.ts
|
|
4
4
|
function isComponentStyleSheet(id) {
|
|
5
5
|
return id.includes("ngcomp=");
|
|
6
6
|
}
|
|
@@ -63,7 +63,6 @@ function encapsulateViteCssOutput(code, componentId) {
|
|
|
63
63
|
}
|
|
64
64
|
return encapsulateStyle(code, componentId);
|
|
65
65
|
}
|
|
66
|
-
//#endregion
|
|
67
66
|
export { encapsulateViteCssOutput, encapsulationPlugin, getComponentStyleSheetMeta, isComponentStyleSheet };
|
|
68
67
|
|
|
69
68
|
//# sourceMappingURL=encapsulation-plugin.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// packages/vite-plugin-angular/src/lib/fast-compile-api.ts
|
|
2
2
|
/** Finds the fast compile plugin's API among resolved Vite plugins. */
|
|
3
3
|
function findFastCompileApi(plugins) {
|
|
4
4
|
for (const plugin of plugins) {
|
|
@@ -6,7 +6,6 @@ function findFastCompileApi(plugins) {
|
|
|
6
6
|
if (api?.fastCompile) return api.fastCompile;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
//#endregion
|
|
10
9
|
export { findFastCompileApi };
|
|
11
10
|
|
|
12
11
|
//# sourceMappingURL=fast-compile-api.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { parseOxc } from "./compiler/utils.js";
|
|
2
|
+
import { createAngularBuildContext, isAngularBuildContext } from "./angular-build-context.js";
|
|
3
|
+
import "./compiler/index.js";
|
|
4
|
+
import { reportStylesheetError } from "./utils/stylesheet-warning.js";
|
|
5
|
+
import { TS_EXT_REGEX, createDepOptimizerConfig, getTsConfigPath, isProdMode } from "./utils/plugin-config.js";
|
|
3
6
|
import { isIgnoredHmrFile } from "./utils/compilation-shared.js";
|
|
7
|
+
import { releaseCssPreprocessorWorkers } from "./utils/css-preprocessor-workers.js";
|
|
4
8
|
import { isRolldown } from "./utils/rolldown.js";
|
|
5
|
-
import { TS_EXT_REGEX, createDepOptimizerConfig, getTsConfigPath, isProdMode } from "./utils/plugin-config.js";
|
|
6
|
-
import { reportStylesheetError } from "./utils/stylesheet-warning.js";
|
|
7
9
|
import { TsconfigResolver } from "./utils/tsconfig-resolver.js";
|
|
8
|
-
import {
|
|
9
|
-
import { releaseCssPreprocessorWorkers } from "./utils/css-preprocessor-workers.js";
|
|
10
|
-
import { loadAngularVirtualModule, resolveAngularVirtualId } from "./virtual-modules-plugin.js";
|
|
10
|
+
import { ComponentScanner } from "./component-scanner.js";
|
|
11
11
|
import { ANGULAR_DECORATOR_CALL_RE } from "./compiler/constants.js";
|
|
12
|
-
import {
|
|
12
|
+
import { preprocessStylesheet } from "./stylesheet-registry.js";
|
|
13
13
|
import { debugRegistry } from "./compiler/debug.js";
|
|
14
14
|
import { compile } from "./compiler/compile.js";
|
|
15
15
|
import { declaresNonStandaloneComponent, scanFile } from "./compiler/registry.js";
|
|
@@ -17,14 +17,14 @@ import { collectAllImports, collectRelativeReExports } from "./compiler/dts-read
|
|
|
17
17
|
import { jitTransform } from "./compiler/jit-transform.js";
|
|
18
18
|
import { generateHmrCode } from "./compiler/hmr.js";
|
|
19
19
|
import { extractInlineStyles, inlineResourceUrls } from "./compiler/resource-inliner.js";
|
|
20
|
-
import "./
|
|
21
|
-
import {
|
|
20
|
+
import { discoverAnalogIntegrations } from "./analog-plugin-interop.js";
|
|
21
|
+
import { loadAngularVirtualModule, resolveAngularVirtualId } from "./virtual-modules-plugin.js";
|
|
22
22
|
import { promises } from "node:fs";
|
|
23
23
|
import { dirname, resolve } from "node:path";
|
|
24
24
|
import * as vite from "vite";
|
|
25
25
|
import { normalizePath, preprocessCSS } from "vite";
|
|
26
26
|
import * as compilerCli from "@angular/compiler-cli";
|
|
27
|
-
|
|
27
|
+
// packages/vite-plugin-angular/src/lib/fast-compile-plugin.ts
|
|
28
28
|
function isFastCompilePluginOptions(value) {
|
|
29
29
|
return typeof value === "object" && value !== null && !isAngularBuildContext(value) && "tsconfigGetter" in value && typeof value.tsconfigGetter === "function";
|
|
30
30
|
}
|
|
@@ -487,7 +487,6 @@ function fastCompilePlugin(optionsOrCtx) {
|
|
|
487
487
|
}
|
|
488
488
|
};
|
|
489
489
|
}
|
|
490
|
-
//#endregion
|
|
491
490
|
export { fastCompilePlugin, getPathsBasePath };
|
|
492
491
|
|
|
493
492
|
//# sourceMappingURL=fast-compile-plugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fast-compile-plugin.js","names":[],"sources":["../../../src/lib/fast-compile-plugin.ts"],"sourcesContent":["import { promises as fsPromises } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport type { parseSync } from 'oxc-parser';\nimport { parseOxc } from './compiler/utils.js';\nimport * as vite from 'vite';\n\nimport * as compilerCli from '@angular/compiler-cli';\nimport { normalizePath, Plugin, preprocessCSS, ResolvedConfig } from 'vite';\n\nimport {\n createAngularBuildContext,\n isAngularBuildContext,\n type AngularBuildContext,\n type AngularBuildContextOptions,\n} from './angular-build-context.js';\nimport {\n compile,\n scanFile,\n declaresNonStandaloneComponent,\n collectRelativeReExports,\n collectAllImports,\n jitTransform,\n inlineResourceUrls,\n extractInlineStyles,\n generateHmrCode,\n debugRegistry,\n ANGULAR_DECORATOR_CALL_RE,\n type ComponentRegistry,\n} from './compiler/index.js';\nimport { reportStylesheetError } from './utils/stylesheet-warning.js';\n\nimport {\n TS_EXT_REGEX,\n EXCLUDED_TS_EXT_REGEX,\n getTsConfigPath,\n createDepOptimizerConfig,\n isProdMode,\n type TsConfigResolutionContext,\n} from './utils/plugin-config.js';\nimport { isIgnoredHmrFile } from './utils/compilation-shared.js';\nimport { releaseCssPreprocessorWorkers } from './utils/css-preprocessor-workers.js';\nimport { isRolldown } from './utils/rolldown.js';\nimport { TsconfigResolver } from './utils/tsconfig-resolver.js';\nimport type { FastCompileApi } from './fast-compile-api.js';\nimport { ComponentScanner, type ResolveImport } from './component-scanner.js';\nimport type { StylePreprocessor } from './style-preprocessor.js';\nimport { preprocessStylesheet } from './stylesheet-registry.js';\nimport type { TypeCheckerOption } from './utils/lsp-type-checker.js';\nimport {\n discoverAnalogIntegrations,\n type ComponentRegistryEntries,\n type TransformFilter,\n} from './analog-plugin-interop.js';\nimport {\n loadAngularVirtualModule,\n resolveAngularVirtualId,\n} from './virtual-modules-plugin.js';\n\nexport interface FastCompilePluginOptions {\n tsconfigGetter: () => string;\n workspaceRoot: string;\n inlineStylesExtension: string;\n jit: boolean;\n liveReload: boolean;\n isTest: boolean;\n isAstroIntegration: boolean;\n fastCompileMode?: 'full' | 'partial';\n disableTypeChecking?: boolean;\n typeChecker?: TypeCheckerOption;\n include?: string[];\n}\n\nfunction isFastCompilePluginOptions(\n value: unknown,\n): value is FastCompilePluginOptions {\n return (\n typeof value === 'object' &&\n value !== null &&\n !isAngularBuildContext(value) &&\n 'tsconfigGetter' in value &&\n typeof (value as FastCompilePluginOptions).tsconfigGetter === 'function'\n );\n}\n\n/**\n * Directory that `compilerOptions.paths` targets resolve against. Mirrors\n * TypeScript: `baseUrl` when set, otherwise the directory of the config\n * that declares `paths` (`pathsBasePath`, since `baseUrl` is optional\n * from TS 4.1).\n */\nexport function getPathsBasePath(\n options: { baseUrl?: string; pathsBasePath?: string } | undefined,\n fallback: string,\n): string {\n return options?.baseUrl ?? options?.pathsBasePath ?? fallback;\n}\n\nexport function fastCompilePlugin(\n optionsOrCtx?:\n | AngularBuildContext\n | FastCompilePluginOptions\n | AngularBuildContextOptions,\n): Plugin {\n const sharedCtx = isAngularBuildContext(optionsOrCtx)\n ? optionsOrCtx\n : isFastCompilePluginOptions(optionsOrCtx)\n ? undefined\n : createAngularBuildContext({\n ...optionsOrCtx,\n compilationBackend: 'fast',\n });\n\n const pluginOptions: FastCompilePluginOptions = sharedCtx\n ? sharedCtx.options\n : (optionsOrCtx as FastCompilePluginOptions);\n\n // Component registry shared with source formats through `api.fastCompile`\n const scanner = new ComponentScanner();\n const registry = scanner.registry;\n\n const tsconfigResolver =\n sharedCtx?.tsconfigResolver ??\n new TsconfigResolver({\n workspaceRoot: pluginOptions.workspaceRoot,\n include: pluginOptions.include ?? [],\n liveReload: pluginOptions.liveReload,\n isTest: pluginOptions.isTest,\n });\n\n let resolvedConfig: ResolvedConfig;\n let transformFilter: TransformFilter | undefined;\n let componentRegistries: ComponentRegistryEntries[] = [];\n let stylePreprocessor: StylePreprocessor | undefined;\n let tsConfigResolutionContext: TsConfigResolutionContext | null = null;\n let watchMode = false;\n\n // fast-compile plugin state\n const resourceToSource = new Map<string, string>();\n const emittedMaps = new Map<string, string>();\n let useDefineForClassFields = true;\n let tsConfig: ReturnType<typeof compilerCli.readConfiguration>;\n\n // The one-time whole-project scan non-standalone components fall back to.\n let projectScan: Promise<void> | undefined;\n\n /**\n * Scan a file into the registry, then recursively walk its relative\n * `export *` / `export { … } from './x'` chain so any underlying\n * directive classes also land in the registry. Used both at\n * `buildStart` (for tsconfig path entries) and at dev time (file\n * `add` and `handleHotUpdate`) so newly added barrels stay in sync\n * without requiring a server restart.\n *\n * The `visited` set prevents infinite recursion within a single\n * top-level call. Each fresh scan should pass an empty set (so HMR\n * re-scans aren't blocked by buildStart's earlier visits).\n *\n * `fileContents`/`scanResults` are cold-start dedup caches scoped to a\n * single `initFastCompile` call. HMR/watcher callers must omit them so\n * an edited file is always re-read from disk.\n */\n async function scanBarrelExports(\n file: string,\n visited: Set<string> = new Set(),\n overwrite = false,\n fileContents?: Map<string, string>,\n scanResults?: Map<string, ReturnType<typeof scanFile>>,\n ): Promise<void> {\n if (visited.has(file)) return;\n visited.add(file);\n let code: string;\n try {\n code = fileContents?.get(file) ?? (await scanner.readScanSource(file));\n fileContents?.set(file, code);\n } catch (e) {\n if (debugRegistry.enabled) {\n debugRegistry(\n 'scanBarrelExports: failed to read %s: %s',\n file,\n (e as Error)?.message,\n );\n }\n return;\n }\n // Single parse shared by scanFile and collectRelativeReExports. On a\n // parse error each consumer re-parses on its own, preserving their\n // individual failure semantics (scanFile throws past its pre-filter;\n // collectRelativeReExports swallows and returns []).\n let program: ReturnType<typeof parseSync>['program'] | undefined;\n try {\n program = parseOxc(file, code).program;\n } catch {\n program = undefined;\n }\n let entries = scanResults?.get(file);\n if (!entries) {\n entries = scanFile(code, file, program);\n scanResults?.set(file, entries);\n }\n for (const entry of entries) {\n // At buildStart we want stable registry entries (don't overwrite\n // an earlier scan with a barrel re-scan); HMR explicitly asks\n // for overwrite so updated metadata replaces stale entries.\n if (overwrite || !registry.has(entry.className)) {\n registry.set(entry.className, entry);\n }\n }\n // Collect every relative re-export specifier via OXC AST so\n // recursive scans can't trip over each other (a shared `/g` regex\n // would have its `lastIndex` reset by each recursive call and\n // silently skip half of an outer barrel's re-exports, which\n // previously left directives like `HlmRadioGroup` unregistered).\n const dir = dirname(file);\n for (const rel of collectRelativeReExports(code, file, program)) {\n // NodeNext-style libraries write `export * from './foo.js'`\n // even though the source is `./foo.ts`. Strip the ESM\n // extension before probing or the candidates would be\n // `foo.js.ts` / `foo.js/index.ts`, which never exist.\n const normalizedRel = rel.replace(/\\.(?:js|mjs)$/u, '');\n const reExportCandidates = [\n resolve(dir, normalizedRel + '.ts'),\n resolve(dir, normalizedRel, 'index.ts'),\n ];\n let resolved = false;\n for (const candidate of reExportCandidates) {\n try {\n await fsPromises.access(candidate);\n await scanBarrelExports(\n candidate,\n visited,\n overwrite,\n fileContents,\n scanResults,\n );\n resolved = true;\n break;\n } catch {\n // try next candidate\n }\n }\n if (!resolved && debugRegistry.enabled) {\n debugRegistry(\n 'scanBarrelExports: %s re-export %s did not resolve to %o',\n file,\n rel,\n reExportCandidates,\n );\n }\n }\n }\n\n async function initFastCompile(): Promise<void> {\n emittedMaps.clear();\n if (pluginOptions.jit) return; // JIT: no registry scan needed\n\n projectScan = undefined;\n const resolvedTsConfigPath = resolveTsConfigPath();\n const projectRoot = dirname(resolvedTsConfigPath);\n scanner.reset(projectRoot);\n tsConfig = compilerCli.readConfiguration(resolvedTsConfigPath);\n useDefineForClassFields = tsConfig.options?.useDefineForClassFields ?? true;\n }\n\n /** Scan all source files reachable from the tsconfig into the registry. */\n async function scanProject(): Promise<void> {\n const config = tsConfig;\n const extraIncludes = tsconfigResolver.ensureIncludeCache();\n // Collect candidate files: tsconfig rootNames PLUS explicit/integration\n // include globs PLUS the entry points named in `compilerOptions.paths`.\n // App tsconfigs typically only include the app's own sources, so workspace\n // library entry barrels (e.g. `HlmSelectImports = [HlmSelect,\n // HlmSelectContent, ...] as const`) live outside `rootNames` and would\n // otherwise miss the initial scan. The compiler then can't see that\n // `HlmSelectImports` is a tuple barrel and emits the bare identifier into\n // the parent component's `dependencies()` list, where Angular's runtime\n // silently drops it because arrays don't have a directive def.\n const candidates = new Set<string>([...config.rootNames, ...extraIncludes]);\n const tsPaths = config.options?.paths;\n const projectRoot = scanner.projectRoot;\n const baseUrl = getPathsBasePath(config.options, projectRoot);\n // Cold-start dedup caches shared by the three scan phases below\n // (candidates scan, walkImports, scanBarrelExports). Scoped to this\n // init call only — HMR/watcher re-scans must hit disk fresh.\n const fileContents = new Map<string, string>();\n const scanResults = new Map<string, ReturnType<typeof scanFile>>();\n if (tsPaths) {\n for (const targets of Object.values(tsPaths)) {\n for (const target of targets as string[]) {\n // Skip wildcard patterns — entry barrels are normally exact\n // file paths like \"libs/helm/select/src/index.ts\".\n if (target.includes('*')) continue;\n candidates.add(resolve(baseUrl, target));\n }\n }\n }\n const results = await Promise.all(\n Array.from(candidates).map(async (file) => {\n try {\n const code = await scanner.readScanSource(file);\n fileContents.set(file, code);\n const entries = scanFile(code, file);\n scanResults.set(file, entries);\n return entries;\n } catch (e) {\n if (debugRegistry.enabled) {\n debugRegistry(\n 'initFastCompile: skipping unreadable %s: %s',\n file,\n (e as Error)?.message,\n );\n }\n return []; // Skip unreadable files\n }\n }),\n );\n\n for (const entries of results) {\n for (const entry of entries) {\n registry.set(entry.className, entry);\n }\n }\n\n // Walk the transitive import graph from the root files so the registry also\n // contains declarations that live in files not directly in tsconfig\n // `files`/`include` (transitively-imported app sources) and in workspace\n // libraries reached through wildcard `paths` (e.g. `@bitwarden/*`). Without\n // this, a non-standalone component's owning module can't classify its\n // declarations and `ɵɵsetComponentScope` is never emitted for it. Only\n // relative imports and `paths`-mapped (project/workspace) bare specifiers are\n // followed; true `node_modules` packages are left to the lazy `.d.ts` scanner.\n // Return *all* candidate base paths a bare specifier maps to. A `paths`\n // entry can list several fallback targets (e.g. a built `dist` path first\n // and the workspace `src` second); the caller probes them in order.\n const resolvePathSpecifier = (spec: string): string[] => {\n if (!tsPaths) return [];\n for (const [key, targets] of Object.entries(tsPaths)) {\n const list = targets as string[];\n if (key.endsWith('/*')) {\n const prefix = key.slice(0, -1);\n if (spec.startsWith(prefix)) {\n // `split('*').join(...)` substitutes the single tsconfig `*`\n // wildcard without `String.replace`'s first-match-only behavior or\n // `$`-pattern interpretation of the replacement.\n return list.map((t) =>\n resolve(baseUrl, t.split('*').join(spec.slice(prefix.length))),\n );\n }\n } else if (key === spec) {\n return list.map((t) => resolve(baseUrl, t));\n }\n }\n return [];\n };\n const probeToSource = async (base: string): Promise<string | null> => {\n const candidates = base.endsWith('.ts')\n ? [base]\n : [base + '.ts', resolve(base, 'index.ts')];\n for (const candidate of candidates) {\n try {\n await fsPromises.access(candidate);\n return candidate;\n } catch {\n // try next candidate\n }\n }\n return null;\n };\n // Memoize fs probes per absolute base path. The cache stores the\n // Promise (not the settled value) so concurrent walks racing on the\n // same base collapse into a single probe.\n const baseResolveCache = new Map<string, Promise<string | null>>();\n const resolveToSource = (base: string): Promise<string | null> => {\n let probe = baseResolveCache.get(base);\n if (!probe) {\n probe = probeToSource(base);\n baseResolveCache.set(base, probe);\n }\n return probe;\n };\n // Probe each `paths` target in order; first one that resolves to source wins.\n const resolveFirstSource = async (\n bases: string[],\n ): Promise<string | null> => {\n for (const base of bases) {\n const resolved = await resolveToSource(base);\n if (resolved) return resolved;\n }\n return null;\n };\n const importWalkVisited = new Set<string>();\n // Paths-mapped resolution doesn't depend on the importer, so bare\n // specifiers can be memoized by their raw text. Relative specifiers\n // must NOT be — the same './foo' resolves differently per directory.\n const bareSpecResolveCache = new Map<string, Promise<string | null>>();\n const walkImports = async (file: string): Promise<void> => {\n if (importWalkVisited.has(file)) return;\n importWalkVisited.add(file);\n let code: string;\n try {\n code = fileContents.get(file) ?? (await scanner.readScanSource(file));\n fileContents.set(file, code);\n } catch {\n return;\n }\n // Single parse shared by scanFile, the package `.d.ts` scan, and\n // collectAllImports. On a parse error each consumer re-parses on\n // its own, preserving their individual failure semantics.\n let program: ReturnType<typeof parseSync>['program'] | undefined;\n try {\n program = parseOxc(file, code).program;\n } catch {\n program = undefined;\n }\n let entries = scanResults.get(file);\n if (!entries) {\n entries = scanFile(code, file, program);\n scanResults.set(file, entries);\n }\n for (const entry of entries) {\n if (!registry.has(entry.className))\n registry.set(entry.className, entry);\n }\n // Pre-scan the `.d.ts` of every external package this file imports (and,\n // transitively, packages those packages' NgModules re-export — e.g.\n // BrowserModule → CommonModule → NgIf). Doing this at buildStart means the\n // registry is complete before any component transforms, so non-standalone\n // component scope resolves regardless of file transform order.\n scanner.ensureDtsRegistryForSource(code, file, program);\n const dir = dirname(file);\n const targets = await Promise.all(\n collectAllImports(code, file, program).map((spec) => {\n if (spec.startsWith('.')) {\n return resolveToSource(\n resolve(dir, spec.replace(/\\.(?:js|mjs)$/u, '')),\n );\n }\n let resolved = bareSpecResolveCache.get(spec);\n if (!resolved) {\n resolved = resolveFirstSource(resolvePathSpecifier(spec));\n bareSpecResolveCache.set(spec, resolved);\n }\n return resolved;\n }),\n );\n await Promise.all(\n targets.filter((t): t is string => !!t).map((t) => walkImports(t)),\n );\n };\n const walkRoots = [...new Set([...config.rootNames, ...extraIncludes])];\n await Promise.all(walkRoots.map((file) => walkImports(file)));\n\n // Library barrels typically `export * from './lib/...'` rather than\n // declaring directives directly, so the entry file alone gives us\n // the tuple consts but not the directive classes they reference.\n // Walk the relative `export *` chain so the underlying classes also\n // land in the registry. Use a SHARED visited set across all\n // barrels so recursive walks don't double-scan a file that's\n // re-exported from multiple entry points.\n const buildStartVisited = new Set<string>();\n if (tsPaths) {\n const barrelCandidates: string[] = [];\n for (const targets of Object.values(tsPaths)) {\n for (const target of targets as string[]) {\n if (target.includes('*')) continue;\n barrelCandidates.push(resolve(baseUrl, target));\n }\n }\n await Promise.all(\n barrelCandidates.map((c) =>\n scanBarrelExports(\n c,\n buildStartVisited,\n false,\n fileContents,\n scanResults,\n ),\n ),\n );\n }\n debugRegistry(\n 'initFastCompile done: %d entries from %d candidate files',\n registry.size,\n candidates.size,\n );\n }\n\n async function handleFastCompileTransform(\n code: string,\n id: string,\n resolveImport: ResolveImport,\n ): Promise<{ code: string; map: any } | undefined> {\n if (!ANGULAR_DECORATOR_CALL_RE.test(code)) {\n // Non-Angular file — strip TS-only syntax ourselves so barrels\n // like `export { Foo, type Bar } from './x'` and other TS-only\n // forms don't leak unstripped to Rolldown. In rolldown-vite the\n // built-in `vite:oxc` strip is registered as a Rust-side native\n // plugin (`viteTransformPlugin` from `rolldown/experimental`); if\n // its hook-filter treats files our `transform.filter.id.include`\n // claimed as already-handled, no JS-side fallback runs and raw\n // TS reaches the parser → `SyntaxError: Unexpected identifier`.\n const stripped = vite.transformWithOxc\n ? await vite.transformWithOxc(code, id, {\n lang: 'ts',\n sourcemap: true,\n decorator: { legacy: false, emitDecoratorMetadata: false },\n })\n : await vite.transformWithEsbuild(code, id, {\n loader: 'ts',\n sourcemap: true,\n });\n return { code: stripped.code, map: stripped.map };\n }\n\n // JIT mode\n if (pluginOptions.jit) {\n const result = jitTransform(code, id);\n // Strip TypeScript-only syntax (e.g. `readonly`, parameter property\n // modifiers, type annotations on fields) so the output is valid JS\n // for Rolldown. `angularVitestSourcemapPlugin` normally runs this\n // strip downstream in tests, but it is intentionally skipped on\n // StackBlitz / WebContainer — and the production build pipeline\n // does not register it either — so the JIT path must self-strip\n // to stay safe across environments.\n //\n // Pass the jitTransform map as `inMap` so OXC/esbuild emit a map\n // composed with the original `.ts` source — without this, debug\n // stack traces and breakpoints land on the wrong lines once the\n // strip removes any TS-only token. `jitTransform` returns\n // `map: null` for files with no Angular class (no edits made);\n // passing that to OXC/esbuild as `inMap` throws, so coerce to\n // `undefined` in that case.\n const inMap = result.map ?? undefined;\n const stripped = vite.transformWithOxc\n ? await vite.transformWithOxc(\n result.code,\n id,\n {\n lang: 'ts',\n sourcemap: true,\n decorator: { legacy: false, emitDecoratorMetadata: false },\n },\n inMap,\n )\n : await vite.transformWithEsbuild(\n result.code,\n id,\n { loader: 'ts', sourcemap: true },\n inMap,\n );\n return { code: stripped.code, map: stripped.map };\n }\n\n // Inline external templateUrl/styleUrl(s) into the source before compilation.\n // `stylePaths` carries the source path of each inlined external style so\n // it is preprocessed as its own file (e.g. an external `.scss` styleUrl or\n // a relative `@import`) regardless of the `inlineStylesExtension` option.\n const inlined = await inlineResourceUrls(code, id);\n code = inlined.code;\n const { stylePaths } = inlined;\n\n // Track inlined resources for HMR. `compile()` only reports resources it\n // reads through its own fallback (a templateUrl/styleUrl the inliner did\n // NOT already inline), so files inlined here must be recorded here or a\n // later edit to them never invalidates the owning module.\n for (const dep of inlined.resourceDependencies) {\n resourceToSource.set(dep, id);\n }\n\n // Single OXC parse of the post-inline source, shared by every AST\n // consumer below. `inlineResourceUrls` parsed the PRE-inline string,\n // so its program can never be reused here.\n const { program: oxcProgram } = parseOxc(id, code);\n\n // Pre-resolve component styles through the registered style preprocessor\n // and Vite's CSS pipeline (Sass/Less, PostCSS, Tailwind), like ngtsc does.\n // External styleUrls are processed as their own file; truly inline\n // `styles: [...]` use `inlineStylesExtension`.\n let resolvedInlineStyles: Map<number, string> | undefined;\n const styleStrings = extractInlineStyles(code, id, oxcProgram);\n\n if (styleStrings.length > 0) {\n resolvedInlineStyles = new Map();\n const activeConfig = sharedCtx?.resolvedConfig ?? resolvedConfig;\n const activeStylePreprocessor =\n sharedCtx?.stylePreprocessor ?? stylePreprocessor;\n for (let i = 0; i < styleStrings.length; i++) {\n const stylePath =\n stylePaths.get(i) ??\n (scanner.sourceFormatOf(id) ? id + '.ts' : id).replace(\n /\\.ts$/,\n `.inline-${i}.${pluginOptions.inlineStylesExtension || 'css'}`,\n );\n try {\n const preprocessed = preprocessStylesheet(\n styleStrings[i],\n stylePath,\n activeStylePreprocessor,\n {\n filename: stylePath,\n containingFile: id,\n order: i,\n inline: !stylePaths.has(i),\n },\n );\n const processed = await preprocessCSS(\n preprocessed,\n stylePath,\n activeConfig,\n );\n resolvedInlineStyles.set(i, processed.code);\n } catch (e) {\n reportStylesheetError(\n activeConfig?.logger,\n stylePath,\n e,\n activeConfig?.command === 'build',\n );\n }\n }\n if (resolvedInlineStyles.size === 0) resolvedInlineStyles = undefined;\n }\n\n scanner.ensureDtsRegistryForSource(code, id, oxcProgram);\n\n for (const entry of scanFile(code, id, oxcProgram)) {\n registry.set(entry.className, entry);\n }\n // Scan what `id` imports, and recompile it when their metadata changes.\n await scanner.resolveImportSpecifiers(\n collectAllImports(code, id, oxcProgram),\n id,\n resolveImport,\n );\n if (declaresNonStandaloneComponent(oxcProgram)) {\n projectScan ??= scanProject();\n await projectScan;\n }\n\n // Merge registries contributed through `analog.setup()` into this\n // compile's lookup view. Out-of-tree compilers register directive\n // metadata for classes fastCompile can't reach through its\n // tsconfig-driven scan (e.g. `.tsrx` files compiled by `@tsrx/analog`).\n // Without this merge, a TS `@Component({ imports: [X] })` that\n // references such a class hits `_unresolved-${className}` as its\n // selector and the tag never matches at runtime.\n const activeComponentRegistries = sharedCtx\n ? sharedCtx.componentRegistries\n : componentRegistries;\n let compileRegistry: ComponentRegistry = registry;\n if (activeComponentRegistries.some((external) => external.size > 0)) {\n compileRegistry = new Map(registry);\n for (const external of activeComponentRegistries) {\n for (const [k, v] of external) compileRegistry.set(k, v);\n }\n }\n\n const result = compile(code, id, {\n registry: compileRegistry,\n resolvedInlineStyles,\n useDefineForClassFields,\n compilationMode: pluginOptions.fastCompileMode,\n oxcProgram,\n });\n\n // Track resource dependencies for HMR\n for (const dep of result.resourceDependencies) {\n resourceToSource.set(dep, id);\n }\n\n // Strip TypeScript-only syntax and compose the compiler map with the\n // final generated code so downstream breakpoints map back to the source.\n const stripped = vite.transformWithOxc\n ? await vite.transformWithOxc(\n result.code,\n id,\n {\n lang: 'ts',\n sourcemap: true,\n decorator: { legacy: false, emitDecoratorMetadata: false },\n },\n result.map,\n )\n : await vite.transformWithEsbuild(\n result.code,\n id,\n { loader: 'ts', sourcemap: true },\n result.map,\n );\n let outputCode = stripped.code;\n\n // Append HMR code in dev mode\n const activeWatchMode = sharedCtx ? sharedCtx.watchMode : watchMode;\n if (activeWatchMode && pluginOptions.liveReload) {\n const fileDeclarations = scanner.entriesOf(id);\n if (fileDeclarations.length > 0) {\n const localDepClassNames = fileDeclarations.map((e) => e.className);\n outputCode += generateHmrCode(fileDeclarations, localDepClassNames);\n }\n }\n\n return { code: outputCode, map: stripped.map };\n }\n\n function resolveTsConfigPath(): string {\n if (sharedCtx) {\n return sharedCtx.resolveTsConfigPath();\n }\n const resolution = tsConfigResolutionContext ?? {\n root: resolvedConfig?.root || '.',\n isProd: isProdMode(resolvedConfig?.mode),\n isLib: !!resolvedConfig?.build?.lib,\n };\n return getTsConfigPath(\n resolution.root,\n pluginOptions.tsconfigGetter(),\n resolution.isProd,\n pluginOptions.isTest,\n resolution.isLib,\n pluginOptions.workspaceRoot,\n );\n }\n\n const fastCompile: FastCompileApi = {\n registerSourceFormat: (format) => scanner.registerSourceFormat(format),\n scanImports: (specifiers, importer, resolve) =>\n scanner.scanImports(specifiers, importer, resolve),\n resolveSelector: (className) =>\n scanner.lookupSelector(\n className,\n sharedCtx ? sharedCtx.componentRegistries : componentRegistries,\n ),\n async compile(code, id, { resolve, mapToSource }) {\n const transformed = await handleFastCompileTransform(\n code,\n id,\n scanner.toResolveImport(resolve),\n );\n if (!transformed) {\n return undefined;\n }\n const map =\n transformed.map && mapToSource\n ? mapToSource(transformed.map)\n : (transformed.map ?? null);\n if (map) {\n emittedMaps.set(\n normalizePath(id),\n typeof map === 'string' ? map : JSON.stringify(map),\n );\n }\n return { code: transformed.code, map };\n },\n };\n\n const compilerApi = {\n angularCompiler: true as const,\n getTsConfigPath: resolveTsConfigPath,\n getSourceMap: (id: string): string | undefined =>\n emittedMaps.get(normalizePath(id)),\n hasEmitted: (id: string): boolean => emittedMaps.has(normalizePath(id)),\n fastCompile,\n };\n\n sharedCtx?.registerCompiler({\n name: '@analogjs/vite-plugin-angular-fast-compile',\n getTsConfigPath: compilerApi.getTsConfigPath,\n getSourceMap: compilerApi.getSourceMap,\n hasEmitted: compilerApi.hasEmitted,\n });\n\n return {\n name: '@analogjs/vite-plugin-angular-fast-compile',\n api: compilerApi,\n enforce: 'pre' as const,\n async config(config, { command, mode }) {\n watchMode = command === 'serve';\n const isProd = isProdMode(config.mode);\n\n if (sharedCtx) {\n sharedCtx.initConfig(config, { command, mode });\n } else {\n tsConfigResolutionContext = {\n root: config.root || '.',\n isProd,\n isLib: !!config?.build?.lib,\n };\n }\n\n const preliminaryTsConfigPath = resolveTsConfigPath();\n\n const depOptimizer = createDepOptimizerConfig({\n tsconfig: preliminaryTsConfigPath,\n isProd,\n jit: pluginOptions.jit,\n watchMode,\n isTest: pluginOptions.isTest,\n isAstroIntegration: pluginOptions.isAstroIntegration,\n });\n\n // No `resolve.conditions` extension here: the `style` condition is\n // scoped to `.css`-extension requests by\n // `cssExtensionStyleResolverPlugin`.\n return {\n ...(isRolldown() ? { oxc: {} as any } : { esbuild: false }),\n ...depOptimizer,\n };\n },\n async configResolved(config) {\n resolvedConfig = config;\n if (sharedCtx) {\n const integrations = await sharedCtx.resolveConfig(config);\n transformFilter = integrations.transformFilter;\n componentRegistries = integrations.componentRegistries;\n stylePreprocessor = integrations.stylePreprocessor;\n } else {\n const integrations = await discoverAnalogIntegrations(config);\n transformFilter = integrations.transformFilter;\n componentRegistries = integrations.componentRegistries;\n stylePreprocessor = integrations.stylePreprocessor;\n tsconfigResolver.setIntegrationIncludes(integrations.include);\n }\n },\n async buildStart() {\n await initFastCompile();\n },\n closeBundle() {\n const activeWatchMode = sharedCtx ? sharedCtx.watchMode : watchMode;\n if (!activeWatchMode) {\n emittedMaps.clear();\n releaseCssPreprocessorWorkers();\n }\n },\n async handleHotUpdate(ctx) {\n if (\n sharedCtx\n ? sharedCtx.hmr.isIgnoredFile(ctx.file)\n : isIgnoredHmrFile(ctx.file)\n ) {\n return [];\n }\n\n // Resource file changes → invalidate parent .ts module\n if (resourceToSource.has(ctx.file)) {\n const parentSource = resourceToSource.get(ctx.file)!;\n const parentModule = ctx.server.moduleGraph.getModuleById(parentSource);\n if (parentModule) {\n return [parentModule];\n }\n }\n\n if (scanner.isCompiledSource(ctx.file)) {\n const [fileId] = ctx.file.split('?');\n\n // Remove old entries from this file. Cached scans that pulled in\n // this file may now be incomplete.\n const oldEntries = scanner.entriesOf(fileId);\n scanner.invalidate(fileId);\n\n // Rescan the changed file via the barrel-aware scanner so an\n // edited barrel re-export picks up newly-referenced files.\n // Pass overwrite=true so updated metadata replaces stale\n // entries from the previous scan.\n await scanBarrelExports(fileId, new Set(), true);\n\n // Importers compiled the old selector/inputs/outputs into their\n // templates, so recompile them when this file's metadata changed.\n const metadataChanged =\n JSON.stringify(oldEntries) !==\n JSON.stringify(scanner.entriesOf(fileId));\n if (metadataChanged) {\n const importerModules = [\n ...(scanner.importersByFile.get(fileId) ?? []),\n ].flatMap((importer) => [\n ...(ctx.server.moduleGraph.getModulesByFile(importer) ?? []),\n ]);\n return [...ctx.modules, ...importerModules];\n }\n }\n\n // Let Vite handle the rest — the transform hook will recompile\n return ctx.modules;\n },\n resolveId(id, importer) {\n return resolveAngularVirtualId(id, importer, {\n jit: pluginOptions.jit,\n resolvedConfig: sharedCtx?.resolvedConfig ?? resolvedConfig,\n });\n },\n async load(id) {\n return loadAngularVirtualModule(\n this,\n id,\n sharedCtx?.resolvedConfig ?? resolvedConfig,\n );\n },\n transform: {\n filter: {\n id: {\n include: [TS_EXT_REGEX],\n // `?raw` ids already carry Vite's native raw-loader output\n // (`export default \"<source>\"`). Recompiling them as Angular/TS\n // would strip that default export, so leave them to Vite (#2356).\n exclude: [\n /node_modules/,\n 'type=script',\n '@ng/component',\n /[?&]raw\\b/,\n ],\n },\n },\n async handler(code, id) {\n const activeTransformFilter =\n sharedCtx?.transformFilter ?? transformFilter;\n if (activeTransformFilter && !activeTransformFilter(code, id)) {\n return;\n }\n\n if (id.includes('.ts?')) {\n id = id.replace(/\\?(.*)/, '');\n }\n const resolveImport = scanner.toResolveImport((spec, importer) =>\n this.resolve(spec, importer, { skipSelf: true }),\n );\n\n const transformed = await handleFastCompileTransform(\n code,\n id,\n resolveImport,\n );\n if (transformed?.map) {\n emittedMaps.set(\n normalizePath(id),\n typeof transformed.map === 'string'\n ? transformed.map\n : JSON.stringify(transformed.map),\n );\n }\n return transformed;\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA,SAAS,2BACP,OACmC;CACnC,OACE,OAAO,UAAU,YACjB,UAAU,QACV,CAAC,sBAAsB,KAAK,KAC5B,oBAAoB,SACpB,OAAQ,MAAmC,mBAAmB;AAElE;;;;;;;AAQA,SAAgB,iBACd,SACA,UACQ;CACR,OAAO,SAAS,WAAW,SAAS,iBAAiB;AACvD;AAEA,SAAgB,kBACd,cAIQ;CACR,MAAM,YAAY,sBAAsB,YAAY,IAChD,eACA,2BAA2B,YAAY,IACrC,KAAA,IACA,0BAA0B;EACxB,GAAG;EACH,oBAAoB;CACtB,CAAC;CAEP,MAAM,gBAA0C,YAC5C,UAAU,UACT;CAGL,MAAM,UAAU,IAAI,iBAAiB;CACrC,MAAM,WAAW,QAAQ;CAEzB,MAAM,mBACJ,WAAW,oBACX,IAAI,iBAAiB;EACnB,eAAe,cAAc;EAC7B,SAAS,cAAc,WAAW,CAAC;EACnC,YAAY,cAAc;EAC1B,QAAQ,cAAc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YAAY,iBAAiB,QAAQ,KAAK,CAAC,CAC5D,CAAC;KACD,OAAO,CAAC,GAAG,IAAI,SAAS,GAAG,eAAe;IAC5C;GACF;GAGA,OAAO,IAAI;EACb;EACA,UAAU,IAAI,UAAU;GACtB,OAAO,wBAAwB,IAAI,UAAU;IAC3C,KAAK,cAAc;IACnB,gBAAgB,WAAW,kBAAkB;GAC/C,CAAC;EACH;EACA,MAAM,KAAK,IAAI;GACb,OAAO,yBACL,MACA,IACA,WAAW,kBAAkB,cAC/B;EACF;EACA,WAAW;GACT,QAAQ,EACN,IAAI;IACF,SAAS,CAAC,YAAY;IAItB,SAAS;KACP;KACA;KACA;KACA;IACF;GACF,EACF;GACA,MAAM,QAAQ,MAAM,IAAI;IACtB,MAAM,wBACJ,WAAW,mBAAmB;IAChC,IAAI,yBAAyB,CAAC,sBAAsB,MAAM,EAAE,GAC1D;IAGF,IAAI,GAAG,SAAS,MAAM,GACpB,KAAK,GAAG,QAAQ,UAAU,EAAE;IAE9B,MAAM,gBAAgB,QAAQ,iBAAiB,MAAM,aACnD,KAAK,QAAQ,MAAM,UAAU,EAAE,UAAU,KAAK,CAAC,CACjD;IAEA,MAAM,cAAc,MAAM,2BACxB,MACA,IACA,aACF;IACA,IAAI,aAAa,KACf,YAAY,IACV,cAAc,EAAE,GAChB,OAAO,YAAY,QAAQ,WACvB,YAAY,MACZ,KAAK,UAAU,YAAY,GAAG,CACpC;IAEF,OAAO;GACT;EACF;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"fast-compile-plugin.js","names":["fsPromises"],"sources":["../../../src/lib/fast-compile-plugin.ts"],"sourcesContent":["import { promises as fsPromises } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport type { parseSync } from 'oxc-parser';\nimport { parseOxc } from './compiler/utils.js';\nimport * as vite from 'vite';\n\nimport * as compilerCli from '@angular/compiler-cli';\nimport { normalizePath, Plugin, preprocessCSS, ResolvedConfig } from 'vite';\n\nimport {\n createAngularBuildContext,\n isAngularBuildContext,\n type AngularBuildContext,\n type AngularBuildContextOptions,\n} from './angular-build-context.js';\nimport {\n compile,\n scanFile,\n declaresNonStandaloneComponent,\n collectRelativeReExports,\n collectAllImports,\n jitTransform,\n inlineResourceUrls,\n extractInlineStyles,\n generateHmrCode,\n debugRegistry,\n ANGULAR_DECORATOR_CALL_RE,\n type ComponentRegistry,\n} from './compiler/index.js';\nimport { reportStylesheetError } from './utils/stylesheet-warning.js';\n\nimport {\n TS_EXT_REGEX,\n EXCLUDED_TS_EXT_REGEX,\n getTsConfigPath,\n createDepOptimizerConfig,\n isProdMode,\n type TsConfigResolutionContext,\n} from './utils/plugin-config.js';\nimport { isIgnoredHmrFile } from './utils/compilation-shared.js';\nimport { releaseCssPreprocessorWorkers } from './utils/css-preprocessor-workers.js';\nimport { isRolldown } from './utils/rolldown.js';\nimport { TsconfigResolver } from './utils/tsconfig-resolver.js';\nimport type { FastCompileApi } from './fast-compile-api.js';\nimport { ComponentScanner, type ResolveImport } from './component-scanner.js';\nimport type { StylePreprocessor } from './style-preprocessor.js';\nimport { preprocessStylesheet } from './stylesheet-registry.js';\nimport type { TypeCheckerOption } from './utils/lsp-type-checker.js';\nimport {\n discoverAnalogIntegrations,\n type ComponentRegistryEntries,\n type TransformFilter,\n} from './analog-plugin-interop.js';\nimport {\n loadAngularVirtualModule,\n resolveAngularVirtualId,\n} from './virtual-modules-plugin.js';\n\nexport interface FastCompilePluginOptions {\n tsconfigGetter: () => string;\n workspaceRoot: string;\n inlineStylesExtension: string;\n jit: boolean;\n liveReload: boolean;\n isTest: boolean;\n isAstroIntegration: boolean;\n fastCompileMode?: 'full' | 'partial';\n disableTypeChecking?: boolean;\n typeChecker?: TypeCheckerOption;\n include?: string[];\n}\n\nfunction isFastCompilePluginOptions(\n value: unknown,\n): value is FastCompilePluginOptions {\n return (\n typeof value === 'object' &&\n value !== null &&\n !isAngularBuildContext(value) &&\n 'tsconfigGetter' in value &&\n typeof (value as FastCompilePluginOptions).tsconfigGetter === 'function'\n );\n}\n\n/**\n * Directory that `compilerOptions.paths` targets resolve against. Mirrors\n * TypeScript: `baseUrl` when set, otherwise the directory of the config\n * that declares `paths` (`pathsBasePath`, since `baseUrl` is optional\n * from TS 4.1).\n */\nexport function getPathsBasePath(\n options: { baseUrl?: string; pathsBasePath?: string } | undefined,\n fallback: string,\n): string {\n return options?.baseUrl ?? options?.pathsBasePath ?? fallback;\n}\n\nexport function fastCompilePlugin(\n optionsOrCtx?:\n | AngularBuildContext\n | FastCompilePluginOptions\n | AngularBuildContextOptions,\n): Plugin {\n const sharedCtx = isAngularBuildContext(optionsOrCtx)\n ? optionsOrCtx\n : isFastCompilePluginOptions(optionsOrCtx)\n ? undefined\n : createAngularBuildContext({\n ...optionsOrCtx,\n compilationBackend: 'fast',\n });\n\n const pluginOptions: FastCompilePluginOptions = sharedCtx\n ? sharedCtx.options\n : (optionsOrCtx as FastCompilePluginOptions);\n\n // Component registry shared with source formats through `api.fastCompile`\n const scanner = new ComponentScanner();\n const registry = scanner.registry;\n\n const tsconfigResolver =\n sharedCtx?.tsconfigResolver ??\n new TsconfigResolver({\n workspaceRoot: pluginOptions.workspaceRoot,\n include: pluginOptions.include ?? [],\n liveReload: pluginOptions.liveReload,\n isTest: pluginOptions.isTest,\n });\n\n let resolvedConfig: ResolvedConfig;\n let transformFilter: TransformFilter | undefined;\n let componentRegistries: ComponentRegistryEntries[] = [];\n let stylePreprocessor: StylePreprocessor | undefined;\n let tsConfigResolutionContext: TsConfigResolutionContext | null = null;\n let watchMode = false;\n\n // fast-compile plugin state\n const resourceToSource = new Map<string, string>();\n const emittedMaps = new Map<string, string>();\n let useDefineForClassFields = true;\n let tsConfig: ReturnType<typeof compilerCli.readConfiguration>;\n\n // The one-time whole-project scan non-standalone components fall back to.\n let projectScan: Promise<void> | undefined;\n\n /**\n * Scan a file into the registry, then recursively walk its relative\n * `export *` / `export { … } from './x'` chain so any underlying\n * directive classes also land in the registry. Used both at\n * `buildStart` (for tsconfig path entries) and at dev time (file\n * `add` and `handleHotUpdate`) so newly added barrels stay in sync\n * without requiring a server restart.\n *\n * The `visited` set prevents infinite recursion within a single\n * top-level call. Each fresh scan should pass an empty set (so HMR\n * re-scans aren't blocked by buildStart's earlier visits).\n *\n * `fileContents`/`scanResults` are cold-start dedup caches scoped to a\n * single `initFastCompile` call. HMR/watcher callers must omit them so\n * an edited file is always re-read from disk.\n */\n async function scanBarrelExports(\n file: string,\n visited: Set<string> = new Set(),\n overwrite = false,\n fileContents?: Map<string, string>,\n scanResults?: Map<string, ReturnType<typeof scanFile>>,\n ): Promise<void> {\n if (visited.has(file)) return;\n visited.add(file);\n let code: string;\n try {\n code = fileContents?.get(file) ?? (await scanner.readScanSource(file));\n fileContents?.set(file, code);\n } catch (e) {\n if (debugRegistry.enabled) {\n debugRegistry(\n 'scanBarrelExports: failed to read %s: %s',\n file,\n (e as Error)?.message,\n );\n }\n return;\n }\n // Single parse shared by scanFile and collectRelativeReExports. On a\n // parse error each consumer re-parses on its own, preserving their\n // individual failure semantics (scanFile throws past its pre-filter;\n // collectRelativeReExports swallows and returns []).\n let program: ReturnType<typeof parseSync>['program'] | undefined;\n try {\n program = parseOxc(file, code).program;\n } catch {\n program = undefined;\n }\n let entries = scanResults?.get(file);\n if (!entries) {\n entries = scanFile(code, file, program);\n scanResults?.set(file, entries);\n }\n for (const entry of entries) {\n // At buildStart we want stable registry entries (don't overwrite\n // an earlier scan with a barrel re-scan); HMR explicitly asks\n // for overwrite so updated metadata replaces stale entries.\n if (overwrite || !registry.has(entry.className)) {\n registry.set(entry.className, entry);\n }\n }\n // Collect every relative re-export specifier via OXC AST so\n // recursive scans can't trip over each other (a shared `/g` regex\n // would have its `lastIndex` reset by each recursive call and\n // silently skip half of an outer barrel's re-exports, which\n // previously left directives like `HlmRadioGroup` unregistered).\n const dir = dirname(file);\n for (const rel of collectRelativeReExports(code, file, program)) {\n // NodeNext-style libraries write `export * from './foo.js'`\n // even though the source is `./foo.ts`. Strip the ESM\n // extension before probing or the candidates would be\n // `foo.js.ts` / `foo.js/index.ts`, which never exist.\n const normalizedRel = rel.replace(/\\.(?:js|mjs)$/u, '');\n const reExportCandidates = [\n resolve(dir, normalizedRel + '.ts'),\n resolve(dir, normalizedRel, 'index.ts'),\n ];\n let resolved = false;\n for (const candidate of reExportCandidates) {\n try {\n await fsPromises.access(candidate);\n await scanBarrelExports(\n candidate,\n visited,\n overwrite,\n fileContents,\n scanResults,\n );\n resolved = true;\n break;\n } catch {\n // try next candidate\n }\n }\n if (!resolved && debugRegistry.enabled) {\n debugRegistry(\n 'scanBarrelExports: %s re-export %s did not resolve to %o',\n file,\n rel,\n reExportCandidates,\n );\n }\n }\n }\n\n async function initFastCompile(): Promise<void> {\n emittedMaps.clear();\n if (pluginOptions.jit) return; // JIT: no registry scan needed\n\n projectScan = undefined;\n const resolvedTsConfigPath = resolveTsConfigPath();\n const projectRoot = dirname(resolvedTsConfigPath);\n scanner.reset(projectRoot);\n tsConfig = compilerCli.readConfiguration(resolvedTsConfigPath);\n useDefineForClassFields = tsConfig.options?.useDefineForClassFields ?? true;\n }\n\n /** Scan all source files reachable from the tsconfig into the registry. */\n async function scanProject(): Promise<void> {\n const config = tsConfig;\n const extraIncludes = tsconfigResolver.ensureIncludeCache();\n // Collect candidate files: tsconfig rootNames PLUS explicit/integration\n // include globs PLUS the entry points named in `compilerOptions.paths`.\n // App tsconfigs typically only include the app's own sources, so workspace\n // library entry barrels (e.g. `HlmSelectImports = [HlmSelect,\n // HlmSelectContent, ...] as const`) live outside `rootNames` and would\n // otherwise miss the initial scan. The compiler then can't see that\n // `HlmSelectImports` is a tuple barrel and emits the bare identifier into\n // the parent component's `dependencies()` list, where Angular's runtime\n // silently drops it because arrays don't have a directive def.\n const candidates = new Set<string>([...config.rootNames, ...extraIncludes]);\n const tsPaths = config.options?.paths;\n const projectRoot = scanner.projectRoot;\n const baseUrl = getPathsBasePath(config.options, projectRoot);\n // Cold-start dedup caches shared by the three scan phases below\n // (candidates scan, walkImports, scanBarrelExports). Scoped to this\n // init call only — HMR/watcher re-scans must hit disk fresh.\n const fileContents = new Map<string, string>();\n const scanResults = new Map<string, ReturnType<typeof scanFile>>();\n if (tsPaths) {\n for (const targets of Object.values(tsPaths)) {\n for (const target of targets as string[]) {\n // Skip wildcard patterns — entry barrels are normally exact\n // file paths like \"libs/helm/select/src/index.ts\".\n if (target.includes('*')) continue;\n candidates.add(resolve(baseUrl, target));\n }\n }\n }\n const results = await Promise.all(\n Array.from(candidates).map(async (file) => {\n try {\n const code = await scanner.readScanSource(file);\n fileContents.set(file, code);\n const entries = scanFile(code, file);\n scanResults.set(file, entries);\n return entries;\n } catch (e) {\n if (debugRegistry.enabled) {\n debugRegistry(\n 'initFastCompile: skipping unreadable %s: %s',\n file,\n (e as Error)?.message,\n );\n }\n return []; // Skip unreadable files\n }\n }),\n );\n\n for (const entries of results) {\n for (const entry of entries) {\n registry.set(entry.className, entry);\n }\n }\n\n // Walk the transitive import graph from the root files so the registry also\n // contains declarations that live in files not directly in tsconfig\n // `files`/`include` (transitively-imported app sources) and in workspace\n // libraries reached through wildcard `paths` (e.g. `@bitwarden/*`). Without\n // this, a non-standalone component's owning module can't classify its\n // declarations and `ɵɵsetComponentScope` is never emitted for it. Only\n // relative imports and `paths`-mapped (project/workspace) bare specifiers are\n // followed; true `node_modules` packages are left to the lazy `.d.ts` scanner.\n // Return *all* candidate base paths a bare specifier maps to. A `paths`\n // entry can list several fallback targets (e.g. a built `dist` path first\n // and the workspace `src` second); the caller probes them in order.\n const resolvePathSpecifier = (spec: string): string[] => {\n if (!tsPaths) return [];\n for (const [key, targets] of Object.entries(tsPaths)) {\n const list = targets as string[];\n if (key.endsWith('/*')) {\n const prefix = key.slice(0, -1);\n if (spec.startsWith(prefix)) {\n // `split('*').join(...)` substitutes the single tsconfig `*`\n // wildcard without `String.replace`'s first-match-only behavior or\n // `$`-pattern interpretation of the replacement.\n return list.map((t) =>\n resolve(baseUrl, t.split('*').join(spec.slice(prefix.length))),\n );\n }\n } else if (key === spec) {\n return list.map((t) => resolve(baseUrl, t));\n }\n }\n return [];\n };\n const probeToSource = async (base: string): Promise<string | null> => {\n const candidates = base.endsWith('.ts')\n ? [base]\n : [base + '.ts', resolve(base, 'index.ts')];\n for (const candidate of candidates) {\n try {\n await fsPromises.access(candidate);\n return candidate;\n } catch {\n // try next candidate\n }\n }\n return null;\n };\n // Memoize fs probes per absolute base path. The cache stores the\n // Promise (not the settled value) so concurrent walks racing on the\n // same base collapse into a single probe.\n const baseResolveCache = new Map<string, Promise<string | null>>();\n const resolveToSource = (base: string): Promise<string | null> => {\n let probe = baseResolveCache.get(base);\n if (!probe) {\n probe = probeToSource(base);\n baseResolveCache.set(base, probe);\n }\n return probe;\n };\n // Probe each `paths` target in order; first one that resolves to source wins.\n const resolveFirstSource = async (\n bases: string[],\n ): Promise<string | null> => {\n for (const base of bases) {\n const resolved = await resolveToSource(base);\n if (resolved) return resolved;\n }\n return null;\n };\n const importWalkVisited = new Set<string>();\n // Paths-mapped resolution doesn't depend on the importer, so bare\n // specifiers can be memoized by their raw text. Relative specifiers\n // must NOT be — the same './foo' resolves differently per directory.\n const bareSpecResolveCache = new Map<string, Promise<string | null>>();\n const walkImports = async (file: string): Promise<void> => {\n if (importWalkVisited.has(file)) return;\n importWalkVisited.add(file);\n let code: string;\n try {\n code = fileContents.get(file) ?? (await scanner.readScanSource(file));\n fileContents.set(file, code);\n } catch {\n return;\n }\n // Single parse shared by scanFile, the package `.d.ts` scan, and\n // collectAllImports. On a parse error each consumer re-parses on\n // its own, preserving their individual failure semantics.\n let program: ReturnType<typeof parseSync>['program'] | undefined;\n try {\n program = parseOxc(file, code).program;\n } catch {\n program = undefined;\n }\n let entries = scanResults.get(file);\n if (!entries) {\n entries = scanFile(code, file, program);\n scanResults.set(file, entries);\n }\n for (const entry of entries) {\n if (!registry.has(entry.className))\n registry.set(entry.className, entry);\n }\n // Pre-scan the `.d.ts` of every external package this file imports (and,\n // transitively, packages those packages' NgModules re-export — e.g.\n // BrowserModule → CommonModule → NgIf). Doing this at buildStart means the\n // registry is complete before any component transforms, so non-standalone\n // component scope resolves regardless of file transform order.\n scanner.ensureDtsRegistryForSource(code, file, program);\n const dir = dirname(file);\n const targets = await Promise.all(\n collectAllImports(code, file, program).map((spec) => {\n if (spec.startsWith('.')) {\n return resolveToSource(\n resolve(dir, spec.replace(/\\.(?:js|mjs)$/u, '')),\n );\n }\n let resolved = bareSpecResolveCache.get(spec);\n if (!resolved) {\n resolved = resolveFirstSource(resolvePathSpecifier(spec));\n bareSpecResolveCache.set(spec, resolved);\n }\n return resolved;\n }),\n );\n await Promise.all(\n targets.filter((t): t is string => !!t).map((t) => walkImports(t)),\n );\n };\n const walkRoots = [...new Set([...config.rootNames, ...extraIncludes])];\n await Promise.all(walkRoots.map((file) => walkImports(file)));\n\n // Library barrels typically `export * from './lib/...'` rather than\n // declaring directives directly, so the entry file alone gives us\n // the tuple consts but not the directive classes they reference.\n // Walk the relative `export *` chain so the underlying classes also\n // land in the registry. Use a SHARED visited set across all\n // barrels so recursive walks don't double-scan a file that's\n // re-exported from multiple entry points.\n const buildStartVisited = new Set<string>();\n if (tsPaths) {\n const barrelCandidates: string[] = [];\n for (const targets of Object.values(tsPaths)) {\n for (const target of targets as string[]) {\n if (target.includes('*')) continue;\n barrelCandidates.push(resolve(baseUrl, target));\n }\n }\n await Promise.all(\n barrelCandidates.map((c) =>\n scanBarrelExports(\n c,\n buildStartVisited,\n false,\n fileContents,\n scanResults,\n ),\n ),\n );\n }\n debugRegistry(\n 'initFastCompile done: %d entries from %d candidate files',\n registry.size,\n candidates.size,\n );\n }\n\n async function handleFastCompileTransform(\n code: string,\n id: string,\n resolveImport: ResolveImport,\n ): Promise<{ code: string; map: any } | undefined> {\n if (!ANGULAR_DECORATOR_CALL_RE.test(code)) {\n // Non-Angular file — strip TS-only syntax ourselves so barrels\n // like `export { Foo, type Bar } from './x'` and other TS-only\n // forms don't leak unstripped to Rolldown. In rolldown-vite the\n // built-in `vite:oxc` strip is registered as a Rust-side native\n // plugin (`viteTransformPlugin` from `rolldown/experimental`); if\n // its hook-filter treats files our `transform.filter.id.include`\n // claimed as already-handled, no JS-side fallback runs and raw\n // TS reaches the parser → `SyntaxError: Unexpected identifier`.\n const stripped = vite.transformWithOxc\n ? await vite.transformWithOxc(code, id, {\n lang: 'ts',\n sourcemap: true,\n decorator: { legacy: false, emitDecoratorMetadata: false },\n })\n : await vite.transformWithEsbuild(code, id, {\n loader: 'ts',\n sourcemap: true,\n });\n return { code: stripped.code, map: stripped.map };\n }\n\n // JIT mode\n if (pluginOptions.jit) {\n const result = jitTransform(code, id);\n // Strip TypeScript-only syntax (e.g. `readonly`, parameter property\n // modifiers, type annotations on fields) so the output is valid JS\n // for Rolldown. `angularVitestSourcemapPlugin` normally runs this\n // strip downstream in tests, but it is intentionally skipped on\n // StackBlitz / WebContainer — and the production build pipeline\n // does not register it either — so the JIT path must self-strip\n // to stay safe across environments.\n //\n // Pass the jitTransform map as `inMap` so OXC/esbuild emit a map\n // composed with the original `.ts` source — without this, debug\n // stack traces and breakpoints land on the wrong lines once the\n // strip removes any TS-only token. `jitTransform` returns\n // `map: null` for files with no Angular class (no edits made);\n // passing that to OXC/esbuild as `inMap` throws, so coerce to\n // `undefined` in that case.\n const inMap = result.map ?? undefined;\n const stripped = vite.transformWithOxc\n ? await vite.transformWithOxc(\n result.code,\n id,\n {\n lang: 'ts',\n sourcemap: true,\n decorator: { legacy: false, emitDecoratorMetadata: false },\n },\n inMap,\n )\n : await vite.transformWithEsbuild(\n result.code,\n id,\n { loader: 'ts', sourcemap: true },\n inMap,\n );\n return { code: stripped.code, map: stripped.map };\n }\n\n // Inline external templateUrl/styleUrl(s) into the source before compilation.\n // `stylePaths` carries the source path of each inlined external style so\n // it is preprocessed as its own file (e.g. an external `.scss` styleUrl or\n // a relative `@import`) regardless of the `inlineStylesExtension` option.\n const inlined = await inlineResourceUrls(code, id);\n code = inlined.code;\n const { stylePaths } = inlined;\n\n // Track inlined resources for HMR. `compile()` only reports resources it\n // reads through its own fallback (a templateUrl/styleUrl the inliner did\n // NOT already inline), so files inlined here must be recorded here or a\n // later edit to them never invalidates the owning module.\n for (const dep of inlined.resourceDependencies) {\n resourceToSource.set(dep, id);\n }\n\n // Single OXC parse of the post-inline source, shared by every AST\n // consumer below. `inlineResourceUrls` parsed the PRE-inline string,\n // so its program can never be reused here.\n const { program: oxcProgram } = parseOxc(id, code);\n\n // Pre-resolve component styles through the registered style preprocessor\n // and Vite's CSS pipeline (Sass/Less, PostCSS, Tailwind), like ngtsc does.\n // External styleUrls are processed as their own file; truly inline\n // `styles: [...]` use `inlineStylesExtension`.\n let resolvedInlineStyles: Map<number, string> | undefined;\n const styleStrings = extractInlineStyles(code, id, oxcProgram);\n\n if (styleStrings.length > 0) {\n resolvedInlineStyles = new Map();\n const activeConfig = sharedCtx?.resolvedConfig ?? resolvedConfig;\n const activeStylePreprocessor =\n sharedCtx?.stylePreprocessor ?? stylePreprocessor;\n for (let i = 0; i < styleStrings.length; i++) {\n const stylePath =\n stylePaths.get(i) ??\n (scanner.sourceFormatOf(id) ? id + '.ts' : id).replace(\n /\\.ts$/,\n `.inline-${i}.${pluginOptions.inlineStylesExtension || 'css'}`,\n );\n try {\n const preprocessed = preprocessStylesheet(\n styleStrings[i],\n stylePath,\n activeStylePreprocessor,\n {\n filename: stylePath,\n containingFile: id,\n order: i,\n inline: !stylePaths.has(i),\n },\n );\n const processed = await preprocessCSS(\n preprocessed,\n stylePath,\n activeConfig,\n );\n resolvedInlineStyles.set(i, processed.code);\n } catch (e) {\n reportStylesheetError(\n activeConfig?.logger,\n stylePath,\n e,\n activeConfig?.command === 'build',\n );\n }\n }\n if (resolvedInlineStyles.size === 0) resolvedInlineStyles = undefined;\n }\n\n scanner.ensureDtsRegistryForSource(code, id, oxcProgram);\n\n for (const entry of scanFile(code, id, oxcProgram)) {\n registry.set(entry.className, entry);\n }\n // Scan what `id` imports, and recompile it when their metadata changes.\n await scanner.resolveImportSpecifiers(\n collectAllImports(code, id, oxcProgram),\n id,\n resolveImport,\n );\n if (declaresNonStandaloneComponent(oxcProgram)) {\n projectScan ??= scanProject();\n await projectScan;\n }\n\n // Merge registries contributed through `analog.setup()` into this\n // compile's lookup view. Out-of-tree compilers register directive\n // metadata for classes fastCompile can't reach through its\n // tsconfig-driven scan (e.g. `.tsrx` files compiled by `@tsrx/analog`).\n // Without this merge, a TS `@Component({ imports: [X] })` that\n // references such a class hits `_unresolved-${className}` as its\n // selector and the tag never matches at runtime.\n const activeComponentRegistries = sharedCtx\n ? sharedCtx.componentRegistries\n : componentRegistries;\n let compileRegistry: ComponentRegistry = registry;\n if (activeComponentRegistries.some((external) => external.size > 0)) {\n compileRegistry = new Map(registry);\n for (const external of activeComponentRegistries) {\n for (const [k, v] of external) compileRegistry.set(k, v);\n }\n }\n\n const result = compile(code, id, {\n registry: compileRegistry,\n resolvedInlineStyles,\n useDefineForClassFields,\n compilationMode: pluginOptions.fastCompileMode,\n oxcProgram,\n });\n\n // Track resource dependencies for HMR\n for (const dep of result.resourceDependencies) {\n resourceToSource.set(dep, id);\n }\n\n // Strip TypeScript-only syntax and compose the compiler map with the\n // final generated code so downstream breakpoints map back to the source.\n const stripped = vite.transformWithOxc\n ? await vite.transformWithOxc(\n result.code,\n id,\n {\n lang: 'ts',\n sourcemap: true,\n decorator: { legacy: false, emitDecoratorMetadata: false },\n },\n result.map,\n )\n : await vite.transformWithEsbuild(\n result.code,\n id,\n { loader: 'ts', sourcemap: true },\n result.map,\n );\n let outputCode = stripped.code;\n\n // Append HMR code in dev mode\n const activeWatchMode = sharedCtx ? sharedCtx.watchMode : watchMode;\n if (activeWatchMode && pluginOptions.liveReload) {\n const fileDeclarations = scanner.entriesOf(id);\n if (fileDeclarations.length > 0) {\n const localDepClassNames = fileDeclarations.map((e) => e.className);\n outputCode += generateHmrCode(fileDeclarations, localDepClassNames);\n }\n }\n\n return { code: outputCode, map: stripped.map };\n }\n\n function resolveTsConfigPath(): string {\n if (sharedCtx) {\n return sharedCtx.resolveTsConfigPath();\n }\n const resolution = tsConfigResolutionContext ?? {\n root: resolvedConfig?.root || '.',\n isProd: isProdMode(resolvedConfig?.mode),\n isLib: !!resolvedConfig?.build?.lib,\n };\n return getTsConfigPath(\n resolution.root,\n pluginOptions.tsconfigGetter(),\n resolution.isProd,\n pluginOptions.isTest,\n resolution.isLib,\n pluginOptions.workspaceRoot,\n );\n }\n\n const fastCompile: FastCompileApi = {\n registerSourceFormat: (format) => scanner.registerSourceFormat(format),\n scanImports: (specifiers, importer, resolve) =>\n scanner.scanImports(specifiers, importer, resolve),\n resolveSelector: (className) =>\n scanner.lookupSelector(\n className,\n sharedCtx ? sharedCtx.componentRegistries : componentRegistries,\n ),\n async compile(code, id, { resolve, mapToSource }) {\n const transformed = await handleFastCompileTransform(\n code,\n id,\n scanner.toResolveImport(resolve),\n );\n if (!transformed) {\n return undefined;\n }\n const map =\n transformed.map && mapToSource\n ? mapToSource(transformed.map)\n : (transformed.map ?? null);\n if (map) {\n emittedMaps.set(\n normalizePath(id),\n typeof map === 'string' ? map : JSON.stringify(map),\n );\n }\n return { code: transformed.code, map };\n },\n };\n\n const compilerApi = {\n angularCompiler: true as const,\n getTsConfigPath: resolveTsConfigPath,\n getSourceMap: (id: string): string | undefined =>\n emittedMaps.get(normalizePath(id)),\n hasEmitted: (id: string): boolean => emittedMaps.has(normalizePath(id)),\n fastCompile,\n };\n\n sharedCtx?.registerCompiler({\n name: '@analogjs/vite-plugin-angular-fast-compile',\n getTsConfigPath: compilerApi.getTsConfigPath,\n getSourceMap: compilerApi.getSourceMap,\n hasEmitted: compilerApi.hasEmitted,\n });\n\n return {\n name: '@analogjs/vite-plugin-angular-fast-compile',\n api: compilerApi,\n enforce: 'pre' as const,\n async config(config, { command, mode }) {\n watchMode = command === 'serve';\n const isProd = isProdMode(config.mode);\n\n if (sharedCtx) {\n sharedCtx.initConfig(config, { command, mode });\n } else {\n tsConfigResolutionContext = {\n root: config.root || '.',\n isProd,\n isLib: !!config?.build?.lib,\n };\n }\n\n const preliminaryTsConfigPath = resolveTsConfigPath();\n\n const depOptimizer = createDepOptimizerConfig({\n tsconfig: preliminaryTsConfigPath,\n isProd,\n jit: pluginOptions.jit,\n watchMode,\n isTest: pluginOptions.isTest,\n isAstroIntegration: pluginOptions.isAstroIntegration,\n });\n\n // No `resolve.conditions` extension here: the `style` condition is\n // scoped to `.css`-extension requests by\n // `cssExtensionStyleResolverPlugin`.\n return {\n ...(isRolldown() ? { oxc: {} as any } : { esbuild: false }),\n ...depOptimizer,\n };\n },\n async configResolved(config) {\n resolvedConfig = config;\n if (sharedCtx) {\n const integrations = await sharedCtx.resolveConfig(config);\n transformFilter = integrations.transformFilter;\n componentRegistries = integrations.componentRegistries;\n stylePreprocessor = integrations.stylePreprocessor;\n } else {\n const integrations = await discoverAnalogIntegrations(config);\n transformFilter = integrations.transformFilter;\n componentRegistries = integrations.componentRegistries;\n stylePreprocessor = integrations.stylePreprocessor;\n tsconfigResolver.setIntegrationIncludes(integrations.include);\n }\n },\n async buildStart() {\n await initFastCompile();\n },\n closeBundle() {\n const activeWatchMode = sharedCtx ? sharedCtx.watchMode : watchMode;\n if (!activeWatchMode) {\n emittedMaps.clear();\n releaseCssPreprocessorWorkers();\n }\n },\n async handleHotUpdate(ctx) {\n if (\n sharedCtx\n ? sharedCtx.hmr.isIgnoredFile(ctx.file)\n : isIgnoredHmrFile(ctx.file)\n ) {\n return [];\n }\n\n // Resource file changes → invalidate parent .ts module\n if (resourceToSource.has(ctx.file)) {\n const parentSource = resourceToSource.get(ctx.file)!;\n const parentModule = ctx.server.moduleGraph.getModuleById(parentSource);\n if (parentModule) {\n return [parentModule];\n }\n }\n\n if (scanner.isCompiledSource(ctx.file)) {\n const [fileId] = ctx.file.split('?');\n\n // Remove old entries from this file. Cached scans that pulled in\n // this file may now be incomplete.\n const oldEntries = scanner.entriesOf(fileId);\n scanner.invalidate(fileId);\n\n // Rescan the changed file via the barrel-aware scanner so an\n // edited barrel re-export picks up newly-referenced files.\n // Pass overwrite=true so updated metadata replaces stale\n // entries from the previous scan.\n await scanBarrelExports(fileId, new Set(), true);\n\n // Importers compiled the old selector/inputs/outputs into their\n // templates, so recompile them when this file's metadata changed.\n const metadataChanged =\n JSON.stringify(oldEntries) !==\n JSON.stringify(scanner.entriesOf(fileId));\n if (metadataChanged) {\n const importerModules = [\n ...(scanner.importersByFile.get(fileId) ?? []),\n ].flatMap((importer) => [\n ...(ctx.server.moduleGraph.getModulesByFile(importer) ?? []),\n ]);\n return [...ctx.modules, ...importerModules];\n }\n }\n\n // Let Vite handle the rest — the transform hook will recompile\n return ctx.modules;\n },\n resolveId(id, importer) {\n return resolveAngularVirtualId(id, importer, {\n jit: pluginOptions.jit,\n resolvedConfig: sharedCtx?.resolvedConfig ?? resolvedConfig,\n });\n },\n async load(id) {\n return loadAngularVirtualModule(\n this,\n id,\n sharedCtx?.resolvedConfig ?? resolvedConfig,\n );\n },\n transform: {\n filter: {\n id: {\n include: [TS_EXT_REGEX],\n // `?raw` ids already carry Vite's native raw-loader output\n // (`export default \"<source>\"`). Recompiling them as Angular/TS\n // would strip that default export, so leave them to Vite (#2356).\n exclude: [\n /node_modules/,\n 'type=script',\n '@ng/component',\n /[?&]raw\\b/,\n ],\n },\n },\n async handler(code, id) {\n const activeTransformFilter =\n sharedCtx?.transformFilter ?? transformFilter;\n if (activeTransformFilter && !activeTransformFilter(code, id)) {\n return;\n }\n\n if (id.includes('.ts?')) {\n id = id.replace(/\\?(.*)/, '');\n }\n const resolveImport = scanner.toResolveImport((spec, importer) =>\n this.resolve(spec, importer, { skipSelf: true }),\n );\n\n const transformed = await handleFastCompileTransform(\n code,\n id,\n resolveImport,\n );\n if (transformed?.map) {\n emittedMaps.set(\n normalizePath(id),\n typeof transformed.map === 'string'\n ? transformed.map\n : JSON.stringify(transformed.map),\n );\n }\n return transformed;\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAw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,iBAAiB,MAAM,aACnD,KAAK,QAAQ,MAAM,UAAU,EAAE,UAAU,KAAK,CAAC,CACjD;IAEA,MAAM,cAAc,MAAM,2BACxB,MACA,IACA,aACF;IACA,IAAI,aAAa,KACf,YAAY,IACV,cAAc,EAAE,GAChB,OAAO,YAAY,QAAQ,WACvB,YAAY,MACZ,KAAK,UAAU,YAAY,GAAG,CACpC;IAEF,OAAO;GACT;EACF;CACF;AACF"}
|
package/src/lib/host.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { normalizeStylesheetDependencies } from "./style-preprocessor.js";
|
|
2
|
-
import { debugStyles } from "./utils/debug.js";
|
|
3
2
|
import { preprocessStylesheetResult, registerStylesheetContent } from "./stylesheet-registry.js";
|
|
4
|
-
import {
|
|
3
|
+
import { debugStyles } from "./utils/debug.js";
|
|
5
4
|
import { reportStylesheetError } from "./utils/stylesheet-warning.js";
|
|
5
|
+
import { EXCLUDED_TS_EXT_REGEX, TS_EXT_REGEX } from "./utils/plugin-config.js";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { normalizePath } from "vite";
|
|
9
9
|
import * as ts from "typescript";
|
|
10
|
-
|
|
10
|
+
// packages/vite-plugin-angular/src/lib/host.ts
|
|
11
11
|
function augmentHostWithModuleResolution(host, options) {
|
|
12
12
|
const resolutionCache = ts.createModuleResolutionCache(host.getCurrentDirectory(), host.getCanonicalFileName.bind(host), options);
|
|
13
13
|
host.getModuleResolutionCache = () => resolutionCache;
|
|
@@ -132,7 +132,6 @@ function hasStyleExtension(file) {
|
|
|
132
132
|
default: return false;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
//#endregion
|
|
136
135
|
export { augmentHostWithCaching, augmentHostWithModuleResolution, augmentHostWithResources, augmentProgramWithVersioning, mergeTransformers };
|
|
137
136
|
|
|
138
137
|
//# sourceMappingURL=host.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { normalizePath } from "vite";
|
|
2
|
-
|
|
2
|
+
// packages/vite-plugin-angular/src/lib/hot-update-batch.ts
|
|
3
3
|
var HOT_UPDATE_DEBOUNCE_MS = 100;
|
|
4
4
|
function createHotUpdateBatcher(compile) {
|
|
5
5
|
let scheduledBatch;
|
|
@@ -170,7 +170,6 @@ function createHotUpdateNotifications(hasPendingCompilations) {
|
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
|
-
//#endregion
|
|
174
173
|
export { createHotUpdateBatcher };
|
|
175
174
|
|
|
176
175
|
//# sourceMappingURL=hot-update-batch.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { debugHmr } from "./utils/debug.js";
|
|
2
1
|
import { isAngularBuildContext } from "./angular-build-context.js";
|
|
2
|
+
import { debugHmr } from "./utils/debug.js";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { normalizePath } from "vite";
|
|
5
|
-
|
|
5
|
+
// packages/vite-plugin-angular/src/lib/live-reload-plugin.ts
|
|
6
6
|
var ANGULAR_COMPONENT_PREFIX = "/@ng/component";
|
|
7
7
|
var FILE_PREFIX = "file:";
|
|
8
8
|
function liveReloadPlugin(ctxOrUpdates) {
|
|
@@ -64,7 +64,6 @@ function liveReloadPlugin(ctxOrUpdates) {
|
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
//#endregion
|
|
68
67
|
export { liveReloadPlugin };
|
|
69
68
|
|
|
70
69
|
//# sourceMappingURL=live-reload-plugin.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// packages/vite-plugin-angular/src/lib/ngp-compile-api.ts
|
|
2
2
|
/** Finds the NGP compile plugin's API among resolved Vite plugins. */
|
|
3
3
|
function findNgpCompileApi(plugins) {
|
|
4
4
|
for (const plugin of plugins) {
|
|
@@ -6,7 +6,6 @@ function findNgpCompileApi(plugins) {
|
|
|
6
6
|
if (api?.ngp) return api.ngp;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
//#endregion
|
|
10
9
|
export { findNgpCompileApi };
|
|
11
10
|
|
|
12
11
|
//# sourceMappingURL=ngp-compile-api.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { discoverAnalogIntegrations } from "./analog-plugin-interop.js";
|
|
2
|
+
import { createAngularBuildContext, isAngularBuildContext } from "./angular-build-context.js";
|
|
3
|
+
import { ComponentScanner } from "./component-scanner.js";
|
|
2
4
|
import { preprocessStylesheet } from "./stylesheet-registry.js";
|
|
3
5
|
import { isIgnoredHmrFile } from "./utils/compilation-shared.js";
|
|
4
|
-
import { angularFullVersion } from "./utils/devkit.js";
|
|
5
|
-
import { isRolldown } from "./utils/rolldown.js";
|
|
6
6
|
import { TS_EXT_REGEX, createDepOptimizerConfig, getTsConfigPath, isProdMode } from "./utils/plugin-config.js";
|
|
7
|
-
import { createAngularBuildContext, isAngularBuildContext } from "./angular-build-context.js";
|
|
8
7
|
import { releaseCssPreprocessorWorkers } from "./utils/css-preprocessor-workers.js";
|
|
9
|
-
import {
|
|
10
|
-
import { ComponentScanner } from "./component-scanner.js";
|
|
8
|
+
import { angularFullVersion } from "./utils/devkit.js";
|
|
11
9
|
import { findHmrComponentUpdates } from "./utils/hmr-component-updates.js";
|
|
12
|
-
import { canonicalPath, createNgpHostFs, fromWasmPath, toWasmPath } from "./utils/ngp-host-fs.js";
|
|
13
10
|
import { LspTypeChecker } from "./utils/lsp-type-checker.js";
|
|
11
|
+
import { canonicalPath, createNgpHostFs, fromWasmPath, toWasmPath } from "./utils/ngp-host-fs.js";
|
|
12
|
+
import { isRolldown } from "./utils/rolldown.js";
|
|
13
|
+
import { loadAngularVirtualModule, resolveAngularVirtualId } from "./virtual-modules-plugin.js";
|
|
14
14
|
import { existsSync, promises, realpathSync } from "node:fs";
|
|
15
15
|
import { createRequire } from "node:module";
|
|
16
16
|
import { dirname, resolve } from "node:path";
|
|
@@ -18,7 +18,7 @@ import * as vite from "vite";
|
|
|
18
18
|
import * as compilerCli from "@angular/compiler-cli";
|
|
19
19
|
import { glob } from "tinyglobby";
|
|
20
20
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
21
|
-
|
|
21
|
+
// packages/vite-plugin-angular/src/lib/ngp-compile-plugin.ts
|
|
22
22
|
/** NGP's `FileUpdateType`. */
|
|
23
23
|
var FILE_CREATED = 0;
|
|
24
24
|
var FILE_DELETED = 1;
|
|
@@ -667,7 +667,6 @@ function ngpCompilePlugin(optionsOrCtx) {
|
|
|
667
667
|
}
|
|
668
668
|
};
|
|
669
669
|
}
|
|
670
|
-
//#endregion
|
|
671
670
|
export { ngpCompilePlugin };
|
|
672
671
|
|
|
673
672
|
//# sourceMappingURL=ngp-compile-plugin.js.map
|